How do I change animation every touch

Get help using Construct 2

Post » Sun Jan 31, 2016 5:22 pm

hi friends, How do I Change the animation and if you pressed again this is returned to the initial animation and so on

sorry by my bad english.

thanks.
B
4
Posts: 23
Reputation: 246

Post » Sun Jan 31, 2016 6:39 pm

deth123 wrote:hi friends, How do I Change the animation and if you pressed again this is returned to the initial animation and so on



You can use a variable to register/control the "touch" order. For example:

Code: Select all
> on touched sprite 
                   varTouch = 1 > play "animation1"
                                             wait 0.1
                                             varTouch = 2
                                 else >  play "animation2"
                                              wait 0.1
                                              varTouch = 1
B
72
S
13
G
2
Posts: 989
Reputation: 6,969

Post » Sun Jan 31, 2016 9:14 pm

on touch

add one to global

if global = set animation

------------------------------------
maybe try some thing like this

on touch
trigger once while true
set animation frame +1
animation frame = 12
set animation frame 0
B
29
S
13
G
10
Posts: 355
Reputation: 8,312

Post » Sun Jan 31, 2016 9:16 pm

Carbincopy wrote:on touch

add one to global

if global = set animation

------------------------------------
maybe try some thing like this

on touch
trigger once while true
set animation frame +1
animation frame = 12
set animation frame 0


---------------------------------------------
could also look at toggle animation if you only have 2 images
B
29
S
13
G
10
Posts: 355
Reputation: 8,312


Return to How do I....?

Who is online

Users browsing this forum: Lancifer, LaurenceBedford, legendaryarcane, Magistross, randomly, Yahoo [Bot] and 11 guests