-
Hey everyone,
I hate to dampen this math lesson but I was wondering if this problem as ever occured with anyone else
Ok heres the problem
1) You have a movieclip, and in my case is called gameInterface. Inside this movieclip, frame two is labeled "beginTransfer"
2) You have another movieclip on the main stage with the name podOne. Inside this movieclip, it does a few checks and makes _root.gameInterface.gotoAndPlay("beginTransfer");
So in other words, when you hitTest this pod, the gameInterface goes to frame 2.
The problem occurs when you copy and paste that podOne onto the stage and change it around to become podTwo. It *should* have the exactly same effect as podOne did. But what happens is , neither podOne nor podTwo make gameInterface goto the label "beginTransfer"
Any thoughts?
I would post the .fla, but I would need to zip it :(
Thanks :)
-
The only thing I can think of is that the code on podOne must have some code that can only be used on podOne for some reason ???
I need the fla to know for sure
-
Maybe you have if...else statement in hittest code. Something like this:
if hittest then go to beginTransfer
else go to someotherframe
Because one of the pods is always returning false from hittest it will send the interface to someotherframe.
-
Thats very true ...
Ok ill give it a whirl ;)
(haha I just said 'whirl') - thanks guys :D
-
Great it works, I can now pick up more then one pod :)
Thanks again
-
Hey,
Well seeing as Im asking all these questions, I thought it would be only fair to show you what Ostil and I are actually working on, so you get a sense of what exactly your helping us with haha ;)
www.carsahoy.com/game/testLevel.swf
Ill explain the run down of the game:
Basically its a space game , the typical space war going on between to sides (humans and aliens I suppose). But unlike your ordinary space game, the hero (you) is NOT a fighter pilot!
But then whats his/her purpose you ask? - To rescue the escape pods from the downed Capital Ships.
There will be multiple levels obviously ranging in difficulty. But what makes the levels difficult is the fact that you must rescue these escape pods and bring them back to the 'main ship' (or something) WHILE the battle is occuring. You can only hold up to three escape pods before you have to return them to the main ship.
This means there will be random shooting (thats why I needed it nick ;) ) going across the screen from BOTH sides of the battle and explosions you must avoid while also avoid hitting the ships/astriods/debris etc
To make it even more stressful, you cannot just 'grab' the escape pods when you see them, no , you have to sit on them and wait for it to 'transfer'. All while shooting goes on around you
Anyways, the website link up there is probably going to be the first level. The first level will be simple , no battle taking place. Your mission will be to rescue the escape pods from an astroid field
Since niether Ostil or I are good with scroll screen, were using multiple screens. To go to another part of the map , you just need to follow the arrows. The link up there is just the very beginning, so you cant really go anywhere.
Use the Arrows to move around , and pick up the pods. The blue circle is where you drop them off (still working on it). You will also see that the hitTests are a bit whacked up, but thats hopefully going to be fixed
Enjoy :)
ps, the escape pods on that link are NOT where they're going to be in the actual level. They're just there for testing. They're actually going to be on the next screen over inside the astoroid field (once its made)
-
I like the graphix but the hitTests are a bit sketchy as you hit the other ships in the middle of nowhere. Also, when I move the ship randomly stops and I have to press up again???
-
Hey,
The hitTests are fixed! :D - well for the most part anyways, Ill put the update on the website
As for randomly stopping ... that never happens to me :S
-
Ok, updated the game, the hittests should be a bit better for the SHIPS, Im still doing the astorioids atm
Once this is done, me and Ostil can start making the first level! :D
-
Must be my computer that makes it stop somehow, but it does.
I'll check it out on my other PC when I get a chance, it should work on that :)
-
Haha ok sounds good nick, starting to get me worried though :S
-
It works fine on my other PC.
The hitTests still need a bit of work as you can get stuck on a ship or hit an asteroid when you don't touch it
Overall, good
-
Yea I know what you mean, but for now they're doable ;)
Thanks :)
-
-
I have a question about the laser code posted here by nick_fisher. It works fine, but my movie clip kinda faintly jitters across the screen, no matter what speed I set it at. Can anyone help me make it glide smoothly? Right now the graphic looks suspiciously like its flashing a subliminal message.
FYI: it's not the getRandom()function - I already checked that out.
function getRandom(minimum, maximum){
return Math.floor(Math.random() * (maximum - minimum +1) + minimum);
}
bonusSpeed = 20;
attachbonus = function () {
// to attach the bonus and set position:
d = getNextHighestDepth();
_root.attachMovie("bonus", "bonus", d);
bonus._x = -bonus._width;
bonus._y = getRandom(250,570);
// to set the target location:
xtarget = Stage.width;
ytarget = getRandom(250,570);
// to set the rotation:
bonus._rotation = (180/Math.PI)*Math.atan2(ytarget-bonus._y, xtarget-bonus._x);
// to set the speed:
xspeed = (xtarget-bonus._x)/bonusSpeed;
yspeed = (ytarget-bonus._y)/bonusSpeed;
};
// make the bonus move and reset when it reaches the target:
onEnterFrame = function () {
if (bonus.hitTest(player)){
trace("hit player");
}
if (bonus._x >= 780) {
bonus.removeMovieClip();
attachbonus.call();
} else {
bonus._x += xspeed;
bonus._y += yspeed;
}
};
-
Not sure what you mean but I think it could be the frame rate???
It should be smooth on a high frame rate
-
I didnt have a problem with it, it worked fine. I work with 30 fps , try setting it to that and run it :)