Page 1 of 1

Attacking in smash bros

PostPosted: Wed Jun 25, 2008 12:49 am
by BlarghNRawr
How do i make pl1 attack pl2 only in the attack animations, instead of on every collision?
if that makes sense...

Re: HELP!! I NEED HELP!!

PostPosted: Wed Jun 25, 2008 12:54 am
by makslane
In the Collision event (or any other event you want) instead add the action as an "Immediate action", add as "Wait for frame action" and set the animation and the frames thats the action must happens.

Re: HELP!! I NEED HELP!!

PostPosted: Tue Jul 08, 2008 1:11 am
by BlarghNRawr
how do i make that work for the whole animation instead of one frame in the animation?

Re: HELP!! I NEED HELP!!

PostPosted: Tue Jul 08, 2008 3:41 am
by DST
Create a variable for each player; attack1 and attack2, global, integers.
On keydown>attack button>player1
Code: Select all
attack1=1;


Then on player1>animationfinish>attackanimation:(use the 'wait for frame' here:)
Code: Select all
attack=0;



so on player2>collision>anyside>player1:
Code: Select all
if (attack1==1){get hurt code here;}


Now it gets just a tiny bit more complicated. You only want to be hurt by the attacking side of player1, not his backside.

To determine sides of player is easy; make a variable called face, actor integer.
When player1>keydown>right:
face=1;
and on player1>keydown>left
face=0;

So now you can combine them, which actually means splitting the event into two;
one is collision>leftside>player1:
Code: Select all
if (attack1==1 && player1.face==0){ get hurt}

And collsion>rightside>player1:
Code: Select all
if (attack1==1 && player1.face==1){gethurt}


Two things i'd like to point out here:
1: i described this all as though i were player2
2: i used two different variable methods. One is actor integer, in which i said "player1.face", and the other was global integer, in which i said "attack1".
You can use either method, which ever works for you.

Global integers: Cons: require new integer, or array cell, for each actor who uses them. Pros: Can be saved. Simple To call.
Actor Integers: Cons: cannot be saved without rerouting them to a global integer. Must state actor name before stating variable, when called from another actor. Pros: can be used for any number of actors.

Hope this helps. If you have any questions, just ask!

Re: Attacking in smash bros

PostPosted: Sat Sep 20, 2008 5:22 pm
by BlarghNRawr
:oops:
can someone please simplify this for me?

Re: Attacking in smash bros

PostPosted: Sun Sep 21, 2008 6:38 am
by smallville
OK i hear what he is saying..........forget that,
anyway you don't have to understand it just follow the instructions and YAY you have a fighting game! :lol: :D
otherwise just download the "fighting demo" in the demo forum....i think that guy with the instructions
made it....

Re: Attacking in smash bros

PostPosted: Sun Sep 21, 2008 10:04 pm
by BlarghNRawr
nevermind, i got it!
(now actual production can actually begin on my game :D )
i just got rid of the sides cuz my players are too small for it to matter

Re: Attacking in smash bros

PostPosted: Sat Sep 27, 2008 12:40 am
by BlarghNRawr
YAY :D
it worked!
and now variables ACTUALLY make sense to me :D