Unable to toggle a sprite based Menu

Get help using Construct 2

Post » Tue Apr 23, 2013 12:36 am

What am I doing wrong here?

Krish
Hey! Did you know that you can hire me to make your games?

Click Here to See More
B
21
S
6
G
5
Posts: 391
Reputation: 5,627

Post » Tue Apr 23, 2013 12:39 am

What is happening is .. my animation is going from "Default" to "NoMusic", but on next touch it never returns back :(

Variable is perfectly toggling to 1 and 0 though.
Krish
Hey! Did you know that you can hire me to make your games?

Click Here to See More
B
21
S
6
G
5
Posts: 391
Reputation: 5,627

Post » Tue Apr 23, 2013 1:00 am

Sorry my bad.. variable doesnt toggle as well.. also I moved that Debug out to a every tick function (obviously was in wrong place).


So once it goes to zero, I cant toggle back to 1.

Is it probably because now user is touching "NoMusic" animation rather than Default?
Krish
Hey! Did you know that you can hire me to make your games?

Click Here to See More
B
21
S
6
G
5
Posts: 391
Reputation: 5,627

Post » Tue Apr 23, 2013 1:07 am

Fixed it.






Why doesn't the earlier screenshot one work though?
Anyone?

If Touch
-> var = something then do something
-> var = somethingelse then do somethingelse

vs

IF touch and var = something do something
If touched and var = somethingelse do somethingelse.


Krish
Hey! Did you know that you can hire me to make your games?

Click Here to See More
B
21
S
6
G
5
Posts: 391
Reputation: 5,627

Post » Tue Apr 23, 2013 2:07 am

Do

[code]+ On Touched Text_Music
++ System: IsMusic = 1
---> set animation "Default"
++ Else
++ System: IsMusic = 0
---> set animation "NoMusic"[/code]

Construct reads events from top to bottom. You want to make sure that the second sub-event fires only when the first condition is false.TL222013-04-23 02:09:27
B
57
S
20
G
7
Posts: 305
Reputation: 8,779


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, jul, nicklowkcmagic, Yahoo [Bot] and 20 guests