How to change animation according to Angle

Get help using Construct 2

Post » Tue May 08, 2012 12:24 pm

Hey there :-) I am new to C2
I have set the Set angle toward action to follow the mouse or touch, but i can not figure out how to change the animation sprite according to det angle.

when the mouse or touch is on the left side of the screen the animation should be set to left, but now its just turning on its head. I can not get it to work :-(

Can anybody help me?
B
4
S
1
Posts: 23
Reputation: 946

Post » Tue May 08, 2012 12:38 pm

Here is a test so you can see what i mean :-)

http://dl.dropbox.com/u/1678586/game6/index.html
B
4
S
1
Posts: 23
Reputation: 946

Post » Tue May 08, 2012 1:51 pm

Try using the 'is within angle' condition.

Sprite is within 90 degrees of 0 degrees: set animation 1
Sprite is within 90 degrees of 180 degrees: set animation 2
etc.
Scirra Founder
B
357
S
214
G
72
Posts: 22,946
Reputation: 178,228

Post » Tue May 08, 2012 2:35 pm

Thanks a lot for your quick awnser :D
It works perfect .
But now i have a new problem.
The right and left animation work fine :-) but they override the eating animation when it collides with the shrimps.
Any solutions for that one?
B
4
S
1
Posts: 23
Reputation: 946

Post » Tue May 08, 2012 2:46 pm

Add another condition "is animation playing" to the left and right animations and use the name of the eating animation in the condition.

After that you can invert the event by right clicking, or by selecting it and pressing "I". That should stop the walk animation from playing, if the eating animation is playing.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Tue May 08, 2012 2:56 pm

THANKS !!!!! :-D
Works perfectly :-D
B
4
S
1
Posts: 23
Reputation: 946


Return to How do I....?

Who is online

Users browsing this forum: badmoodtaylor, Baidu [Spider] and 17 guests