Monster Racer Rush
Select between 5 monster racers, upgrade your monster skill and win the competition!
4.18 / 5.00 3,534 ViewsBuild and Base
Build most powerful forces, unleash hordes of monster and control your soldiers!
3.80 / 5.00 4,200 ViewsHey guys, i'm currently stuck as what to do with my project.
It's basically a side scrolling shooter like Metal Slug, everything seems to work fine but one little thing. The problem is when i press Space bar it's meant to shoot a projectile, which id does...but...if i jump the bullet follows the y axis with me and if i face the other direction, it flips the bullet over to the other side of the screen.
Thank you, help would be very much appreciated
~Matt
When the space bar is pressed attach the bullet animation dynamically to the players current _x and _y and give the depth of the attached bullet animation something like 10+_root.numberofbullets
then you could fire multiple bullets at the same time without it fallowing you.
EX
_root.player.attachMovie("Bullets linkage ID","newname",10+_root.bulletsfired);
_root.bulletsfired+=1;
I'm sure theres other ways but thats just an easy one i thought of.
NOTE: if you do not have the depth change each time then each time the new bullet will replace the other, even if the previous is in mid flight.
Most likely you have no idea of what container you are adding the bullet to. Think over this carefully and you will figure out what you did wrong.
Each time someone abuses hittest, God kills a kitten. Please, learn real collision testing.
Thanks guys, i've changed it to a spawn area rather than a set area already and i have the code:-
_root.attachMovie("projectile", "projectile" + shots, _root.getNextHighestDepth());
but the problem is, is that it shoots continuously all connected together in a row, if i change the getNextHighestDepth to a unit number like:-
_root.attachMovie("projectile", "projectile" + shots, 1);
It shoots one at a time, but if you tap it doesn't finish off it's shot, it just disappears and re-appears out of the gun again. Any idea how to get it to shoot a reasonable amount at a time.
Thank you
~Matt
Here's a reference pic of what i mean, the top one is what i want, the bottom one is what i get
look up something called "setInterval()"
Or, just use variables. E.G. when shoot is true, shoot, then set a timer for when shoot is true again.