How do I manage a character with orthogonal states

Get help using Construct 2

Post » Fri Oct 17, 2014 1:25 am

Hi,

I'm creating a game where my main character has two directions of animations, like in the super mario games:
- Dimension A: stand, run, jump, attack
- Dimension B: lowLife, medLife, highLife

So in this example I have 4*3 = 12 different animations, which my character must be able to play.

Currently I realized this the following way, which I'm not very happy about:
- I have one Sprite with 12 different animations: stand_1, stand_2, stand_3, run_1, run_2, etc.
- I have some variables in my event sheets representing my state.
- depending on my state variables I do some string concatenations to determine the next animation.

Are there any better ways to accomplish the same result?
B
7
S
2
G
1
Posts: 10
Reputation: 577

Post » Fri Oct 17, 2014 1:36 am

The best way is to make the player sprite invisible and use a visible player skin and change the animation as you like.
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,165

Post » Fri Oct 17, 2014 1:39 am

B
60
S
10
G
10
Posts: 1,013
Reputation: 9,165

Post » Fri Oct 17, 2014 1:43 pm

Thx, but I don't understand what you mean by "skin". Could you explain that a little bit deeper?

I found this topic about different player skins. But the answer there encourages exactly my current approach, i.e. having one sprite with 12 different animations and select them by string concatenation.

No, I didn't follow this tutorial, because I only had the free licence, when learning construct (i.e. the sprites where not available). I just browsed it, but couldn't see anything about your skin approach.
B
7
S
2
G
1
Posts: 10
Reputation: 577

Post » Fri Oct 17, 2014 1:57 pm

I guess you could try making the body or skin in a different sprite with it's animation, so when the player runs the animation "Run" plays on the skin sprite and the player too, and then pin the skin sprite to the player.
B
22
S
6
Posts: 244
Reputation: 2,710

Post » Fri Oct 17, 2014 4:57 pm

So you are using that naming convention + variables to determine wich animation to play? Something like:

Variable: Player_State=1. (Lowlife)
Player is on flor and not moving> Set animation= "idle_"&Player_State.

i think this would be pretty good, since you would only need 4 events for the animation + 1 event to change the Player_state variable.
B
10
S
4
Posts: 133
Reputation: 1,543


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 30 guests