View Full Version : Help with Combo Please
sammi
April 30th, 2006, 05:11 PM
Does anybody know how I can create a easy combo actionscript?
when I press spacebar I would like it to play frame 1, press again play frame 2 and so on. I apreciate the help thank you.
Joppe
April 30th, 2006, 06:48 PM
maybe something in the line of
if(Key.isDown(Key.SPACE)){
// Do thing
c++;
if(c > 20){
c=0;
}
if(c < 10 && Key.isDown(Key.SPACE)){
//Do second combo
}
}
^Code doesnt work i think..
InfestedDemon
April 30th, 2006, 07:26 PM
How about something like
ActionScript Code:
if(Key.isDown(Key.SPACE))
//Instance name thing (The next frame thing would be on the same line but on this it goes weird)
nextFrame(); {
That should work
KIERIOSHIMOTO
April 30th, 2006, 08:23 PM
What is this for? A fighting game?
sammi
May 1st, 2006, 04:46 AM
I apreciate the help but please post codes that work thank you.
Joppe
May 1st, 2006, 05:48 AM
c = 0;
h = 0;
space = false;
h.onEnterFrame = function() {
if (count) {
c++;
if (c>20) {
c = 0;
count = false;
}
}
if (Key.isDown(Key.SPACE) && !space) {
space = true;
trace('First combo attack');
count = true;
}
if (c>5 && c<20 && Key.isDown(Key.CONTROL) && space) {
if (h<1) {
trace('second combo');
h = 1;
}
}
if (h>=1) {
h++;
if (h == 20) {
h = 0;
space = false;
}
}
};
Is this good enought for you or should I make the whole game?
KIERIOSHIMOTO
May 1st, 2006, 06:03 AM
calm down joppe....
InfestedDemon
May 1st, 2006, 06:13 AM
i guess he wants the whole game....nutter
Joppe
May 1st, 2006, 01:30 PM
^Im calm, its just that the code(s) were working with a bit of job.. If one cant work a bit why should one help :ponder:
JoshuaJonah
May 1st, 2006, 01:35 PM
I'm with Joppe on this one, he is asking a bit much, and very rudely at that.
sammi
May 1st, 2006, 10:03 PM
I apoligized for being rude its just im away from my pc for awhile n just couldt test out the code at the moment and so I thank you very much for puting in the code Jopp sorry for being so rude Thank you.
Joppe
May 2nd, 2006, 02:51 PM
Yeah but you will probably notice its much more better to fiddle around with the code yourself, even if it doesnt work. You will get that back later on ;)
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.