changing animation

For questions about using Classic.

Post » Mon Aug 01, 2011 3:53 pm

I cant figure it out how to make change animations exactly I want.
I have a character with animation (and set animation on start)
when I get mouse over this character I want to play another animation (I set another animation and it works ok).
but if I click on character I want to play new animation and it does not work (maybe it does not know if it should play animation with mouseover...). I cant find how to solve it. And after this animation I want this sprite to stay at last frame whatever happens.
can someone help?
B
4
S
2
G
1
Posts: 143
Reputation: 1,211

Post » Mon Aug 01, 2011 4:38 pm

You might need to add an event to check which animation is currently playing?

If you have 'animation 1' activated on mouseover, and then try to trigger 'animation 2' on mouse click, it wont work because the condition 'mouseover is still true.

It would be better if you posted the .cap for somebody to look at.
B
19
S
6
G
7
Posts: 1,206
Reputation: 7,300

Post » Mon Aug 01, 2011 6:06 pm

I finally found soulution...
I made a global variable and for first animation (mouseover) I made a condition that value must be less or equal than 0, then I made an event for click on object. first it is adding value to that global variable and than second animation can be played... so it works. but i am really beginner with this. is it ok like that, or there is some more elegant and cleaner way how to do that?
B
4
S
2
G
1
Posts: 143
Reputation: 1,211

Post » Tue Aug 09, 2011 9:57 pm

You could do the following:

Add mouse and keyboard object
Go to layout, new event:(mouse and keyboard>mouse is over object...>set animation...)

Add new event again,:(mouse and keyboard>on object clicked...>Set animation...)

If I am correct
B
9
S
2
G
1
Posts: 14
Reputation: 1,377


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests