Having one var affect another var

Get help using Construct 2

Post » Fri Nov 01, 2013 2:34 am

http://www.dwbailey.com/images/birdandsquirrel.capx

line 75--player collision with bird
(var) squirrelandbird
Im trying to get it to when the bird and player collide, it goes into a squirrelandbird animation of them fighting.....

106-11
birdflying(var)


I have the bird swooping down when the player gets near him..then when he touches the ground he goes into a walk animation..

The question is, if a sprite is in a variable state...is it not possible to interrupt it with another variable state?

Im trying to get the bird and squirrel to wrestle when the they collide, even if the bird is doing its flying or walking...
B
9
S
2
Posts: 272
Reputation: 1,632

Post » Fri Nov 01, 2013 2:37 am

Basically I cant get the collision to work when the player collides with the bird..
B
9
S
2
Posts: 272
Reputation: 1,632

Post » Fri Nov 01, 2013 5:45 am

You need to be careful transitioning states. Your conditions were constantly resetting the state back to 1 or 2, so the animation kept getting reset.

birdandsquirrel_BHT.capx
ImageImageImage
B
71
S
22
G
242
Posts: 3,734
Reputation: 134,994

Post » Fri Nov 01, 2013 7:40 am

well i finally got it to work...it had to do with the order of my two variables....when I moved my collision variable up on the event list , things started happening.....

http://www.dwbailey.com/images/gotittowork.capx

lines 7-9

I did a lot of trial and error to get it to work...

stil not perfect.....the squirrelandbird animation starts to late...some reason it waits until they collide with the ground to start the animation...should be as soon as they collide with eachother...
B
9
S
2
Posts: 272
Reputation: 1,632


Return to How do I....?

Who is online

Users browsing this forum: 25games, Artcadev and 20 guests