I’m developing my first game in Flash, I’ve been using flash for a while so I’m very used to the controls. I have no problem figuring out most of the actionscripting (I’m decent with C++/C# .NET) I’ve been able to get pretty much what I want out of what I’ve read on line as far as tutorials though. I’ve been searching the Google and a couple other sites for an answer to a big problem.
check out my work in progress here:
http://i123.photobucket.com/albums/o…/TheRuiner.swf
My Problem is key presses. I want to be able to press a key (Q) and activate a “punch” then press the key again and activate a second different “punch” like a combo move. I’ve been toying around with my logic and haven’t been able to figure this problem out. Specifically I want to press (Q) to attack “once” and play the whole animation once. Currently when I press (Q) to attack, and hold the key down it will repeat the “attack” animation over and over. I don’t want the animation to repeat until I release the key, and press again. Edit: “I have 2 punches and 2 kicks (seperate animations/movie clips) they are supposed to work together in a 2 key press combo such as: Q,Q = punch,jab or W,Q = kick,jab and so on…”
my current scripting for attacking is as follows:
(this is inside my “hero” movieClip instance)
if (Key.isDown(81)){
this.gotoAndStop("hpunch");
attacking = true;
combo = 1;
updateAfterEvent();
}else if(Key.isDown(81)&&combo==1){
this.gotoAndStop("hjab");
combo=0;
updateAfterEvent();
}else if(Key.isDown(87)){
this.gotoAndStop("hkick");
attacking = true;
combo=1;
updateAfterEvent();
}else if(Key.isDown(87)&&combo==1){
this.gotoAndStop("hstomp");
combo=0;
updateAfterEvent();
}else{
attacking = false;
combo=0;
updateAfterEvent();
}
I was thinking maybe a keylistener function would help, but I don’t see how that would accomplish what I need without loads of coding, of course if thats the only way then I guess I’ll be spending lots of time focusing on it, but if I can avoid it I will.
Thanks in advance… Plz don’t direct me somewhere else unless you can’t help me thx.
Oh, is there any where specfic anyone may know about that casual Flash Programmers talk in a chat room like environment and share ideas. I prefer live conversations as do we all I’m sure.