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
5
S
1
Posts: 24
Reputation: 423

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
74
S
14
G
4
Posts: 1,018
Reputation: 8,139

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,337

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,337


Return to How do I....?

Who is online

Users browsing this forum: dop2000, hao102a2 and 28 guests