Animation Override?

Discussion and feedback on Construct 2

Post » Wed Oct 31, 2012 5:06 pm

So if i'm trying to make my character have air moves, running moves, standing moves, and each have 4 different directions. (running attack, air side attack, land side attack, air up attack, land up attack etc.) Do i put sub categories under every button saying....   If (Move right) is down, and (sub-category - attack right is pressed AND character is on ground DO this) or (Sub-category - attach right is pressed AND character is in air DO This) so on so forth?

And how do I make it so the player can't press a button to initiate another attack until the current one has finished?

I would post my file if I knew how :(

Thanks guys! I'm really enjoying this engine! I spent about 10 hours playing with it yesterday, i just wish there were more tutorials
B
32
S
4
Posts: 405
Reputation: 3,219

Post » Wed Oct 31, 2012 8:20 pm

One easy way to separate movements so that players don't interrupt them is to use some variables.

eg: in air (0 or 1)
on ground (0 or 1)
currentanimation (0, 1, 2, 3)

etc

Then add additional conditions to each type of button press so that they only occur when your player is in the correct state.

eg:

Lets use an air attack as an example, you probably have a different animation for air attacks.

pseudo code:
on keyboard press "jump button" set "in air" variable to "1"

on keyboard press attack (add a second condition of "In air variable is equal to 1"

play air attack animation

else play ground attack animation

that way it will only play the air attack animation if the player is in the air.

hopefully that made sense lol.

B
50
S
21
G
8
Posts: 844
Reputation: 10,299

Post » Wed Oct 31, 2012 9:06 pm

Yup! I understand!   Instead of using variables, i would I just use the platformer actions though right?   Like when player is moving do this if in air or this of on ground?
B
32
S
4
Posts: 405
Reputation: 3,219

Post » Wed Oct 31, 2012 9:48 pm

Yup you can use those conditions as well.

B
50
S
21
G
8
Posts: 844
Reputation: 10,299

Post » Wed Oct 31, 2012 10:47 pm

Hmmmm I have them setup like that though. :(. How do you post the file?
B
32
S
4
Posts: 405
Reputation: 3,219

Post » Fri Nov 02, 2012 12:05 am

Actually a better question would be, which of these methods takes less cpu power? Adding a global variable to check for a value, or using the events?
B
32
S
4
Posts: 405
Reputation: 3,219

Post » Thu Nov 08, 2012 12:27 am

As for my previous question, I found out through reading through tons of posts that it really doesn't matter which you do, the main part of the processing power comes from the animations, so go ahead and load up your events, because they don't use up most of the CPU power.
B
32
S
4
Posts: 405
Reputation: 3,219


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 3 guests