Organization of a large number of animations.

For questions about using Classic.

Post » Sat Jul 18, 2009 8:45 pm

I have a problem.
There is a character with many different animations (running in different directions, standing, jumping, aiming, shooting, etc). In most cases there is condition that when no key is pressed, we set standing animation. Also there are many private variables which control separate parts of animation (e.g. when we press Space - jumping animation is playing, and sprite's 8-direction movement is changed to Bullet movement).
Problem is that I can't set every animation separately, because variables, keys and their inversion, overlap and interfere with each other...
Suggest please right scheme, where sprite with many animations works properly and variables don't interfere with each other.
B
3
S
2
G
3
Posts: 146
Reputation: 1,567

Post » Sat Jul 18, 2009 9:53 pm

Perhaps a finite state automaton?

[url:1cqatvu0]http://en.wikipedia.org/wiki/Finite_automata[/url:1cqatvu0]

They're easy to do with matrixes, though I've even given some thought on making this a behavior.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Sun Jul 19, 2009 12:22 am

I made this thing
Edit: the URL >_<
[url:24qb0p8x]http://www.udec.cl/~jfuente_alba/statemachine.cap[/url:24qb0p8x]

Shift to jump, space to shoot, touch the ground again to go back to the first state :)

Shows a really simple state machine. 3 states, stuffed in the matrix.
On exit, state 1 goes to 2, 2 goes to 3, 3 goes to 1.
Given its so simple, one could have ignored the matrix and set the state directly in the event.
I'm thinking it could get uncomfortable with during, entry and exit conditions and many possible exits and entries for each state, so a behavior would be comfortable.
I'll look into it.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Thu Sep 24, 2009 6:11 pm

use of sub animations and/or groups to disable states might be useful to you.
B
2
S
2
G
4
Posts: 259
Reputation: 1,968


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests