state change

Get help using Construct 2

Post » Mon Oct 14, 2013 1:38 am

http://s93.photobucket.com/user/spawn85027/media/stateChange_zps791bd79c.jpg.html

var: TreeEntranceColorChange

I am trying to change animation of this treeentrance01 sprite..
I have two animation layers, one named TreeEntrance and the other TreeColorChange.


the code is in line 38-40

my way of thinking is..
   
when player collides with treeentrance01(sprite) make var TreeEntranceColorChang=1

so then...

when the player collides with the entrance and the Var(treeentrancecolorchange) is 1

set animation to "treecolorchange"

treeEntranceColorChange = 0   set animation to TreeEntrance

not sure...why its not working...

I know how to set a state for when something is colliding but not sure how to set it for when it isnt?
B
9
S
2
Posts: 272
Reputation: 1,632

Post » Mon Oct 14, 2013 3:11 am

Line 40:
System checks if TreeEntranceColorChange=1, but also checks if TreeEntranceColorChange=0 (subEvents depend on mainEvent)TGeorgeMihai2013-10-14 03:12:27
B
49
S
15
G
6
Posts: 534
Reputation: 7,195

Post » Mon Oct 14, 2013 3:58 am

I just dont know how to set the Variable to 0..when the two objects are not colliding...



how come construct doesnt have that and where can I suggest that at..

sprite--colliding with object(sprite)   variable set =1
sprite-- not colliding with object(sprite) variable set =0

or is the not colling part already implied when you set the var=1 when doing collision with another object?
B
9
S
2
Posts: 272
Reputation: 1,632

Post » Mon Oct 14, 2013 5:04 am

http://s93.photobucket.com/user/spawn85027/media/icheated_zps4f92d59c.jpg.html

well i went another route and got it to work...i feel like I cheated the system some how.
B
9
S
2
Posts: 272
Reputation: 1,632


Return to How do I....?

Who is online

Users browsing this forum: bclikesyou, kalibark2, Lancifer and 28 guests