How do I change a set of animations?

Get help using Construct 2

Post » Sat Sep 26, 2015 8:04 am

I have a character, and he has a walk1 animation and a walk2 animation, for when he's walking left and right. When the character picks up an item, I want then walk1 and walk2 animations to change to different animations.

So at the moment, it looks like:

On left button down -> Play walk1a

On right button down -> Play walk2a

But when he picks up item A, I want this to happen

On left button down -> Play walk1b

On right button down -> Play walk2b

How do I achieve this?
B
5
S
1
Posts: 73
Reputation: 521

Post » Sat Sep 26, 2015 9:11 am

Set a global variable "WalkLeftAnimation" equal to "walk1a".

On left button down -> Play "WalkLeftAnimation"

Then on collision with item (or however you check if the player got the item) set "WalkLeftAnimation" to "walk1b".

Another way of doing it is to add an instance variable to the player object to replace the global variable.
Ba-dum Tsss!
B
11
S
2
G
1
Posts: 45
Reputation: 757

Post » Sat Sep 26, 2015 10:40 am

NicotineLL wrote:Set a global variable "WalkLeftAnimation" equal to "walk1a".

On left button down -> Play "WalkLeftAnimation"

Then on collision with item (or however you check if the player got the item) set "WalkLeftAnimation" to "walk1b".

Another way of doing it is to add an instance variable to the player object to replace the global variable.


Equal to walka?

walk1a, walk2a and b are individual animations. I don't understand.
B
5
S
1
Posts: 73
Reputation: 521

Post » Sun Sep 27, 2015 11:11 am

Ba-dum Tsss!
B
11
S
2
G
1
Posts: 45
Reputation: 757


Return to How do I....?

Who is online

Users browsing this forum: nahima and 21 guests