PDA

View Full Version : Attacks in video game?



RogueProgram
February 2nd, 2008, 03:46 PM
I'm contnuing on the game i did on flash and im trying to make the guy attack when i press spacebar. wat i did was for the guy 's walking anim i double cllicked on the movieclip and edited the frames so every time he walks it animates, and for the attack anim i made a new layer and made a attacking anim on it but when i play the game the guy wont attack when i press spacebar but when i move around it plays both the walking and attack anim at once. and i dont know wat to do.
help plz

Darkblade
February 2nd, 2008, 04:14 PM
ok I suggest looking into this tutorial ;)

http://www.tutorialized.com/view/tutorial/Fighting-Game/10965
or:
http://www.gotoandplay.it/_articles/2006/06/beatemup.php

good luck :) hope that helps

munsterkiler
February 2nd, 2008, 05:00 PM
you shouldn't put on diferent layers.

what you need to do is to create a movieclip cith the walking anim on it and a movieclip with the attack anim on it.

in the guy movieclip you create 2 frames, the first you name it walk and put stop on actionscript, you put the walking movieclip on this frame, in the other frame you put the attack movieclip with the frame label attack, and a stop on actionscript.

you go back where you have the code and you put

if (Key.isDown(Key.SPACE)){
guymovieclip.gotoAndStop("attack");
}else{
guymovieclip.gotoAndStop("walk");
}

now that is a bit of a mess how i m saying all of that, but if you understood it i hope it helped you