Hello everyone who is reading this.
I have make an event if you touch the object and its animation frame =1 then change to 0, if the object animation frame=0 then change to 1.
Here is the file you can download and tell me what are my mistakeshttps://www.dropbox.com/s/fg0tflctg9iqvex/not_working.capx?dl=0
I did something exactly like that with instance variables (I named the variable "frame") rather than comparing frame numbers
The ">=" is because double clicking can increase the variable faster than the software can react.
This was a while ago (Very early effort with C2) and I don't recall why I chose that method, nor do I recall why I chose "tap" over "touch" - but it works perfectly so it may work for you.
I hope that helps!
Thanks Rodak but afterwards in the game if i want to move from 1 to 3 then how will i be able to do that.
Before this I have make a game and this functtion was working very fine but now I don't know why it is not helping.
Rodak or anyone else have anyother idea then please help me.
Thank you so much.
Develop games in your browser. Powerful, performant & highly capable.
The problem with your code is that after you set animation frame to 1 in event #2, you set it back to 0 in event #3.
Simply add Else condition:
Or you can do this all in one event and one action:
On touched sprite-> Sprite set animation frame to (Sprite.AnimationFrame=0)
Thank you dop2000