How do I use Shake (scrollTo)?

Get help using Construct 2

Post » Sun Jul 16, 2017 4:11 am

I've found if you have multiple events that use the shake command on a camera sprite, if you set something like "shake 10px for 8 seconds", and then have another command of "shake 3px for 0.5 seconds", the 8 second shake is stopped.

Is there a way to avoid that from happening?
B
40
S
12
G
1
Posts: 532
Reputation: 4,147

Post » Sun Jul 16, 2017 8:19 am

you have to create a 'shake-system' with a 'shake queue'.

each new shake get a start timer, a dauration and a magnitude.

on each new shake you have to set the shake queue* (and probably adjust the active shake to the new values ) to your needs.
on end of a shake you have the set the next (remaining part) shake in the queue - if any.

*) how you set the queued (future) shakes depends on your needs (e.g. higher magnitude removes lower, short time different magnitude creates a new part shake of the actual shake)

Image
Image Image Image
B
42
S
22
G
15
Posts: 376
Reputation: 12,223

Post » Sun Jul 16, 2017 8:37 pm

@mercuryus - not sure I follow on the best way to do this. Would you use timers or variables?
B
40
S
12
G
1
Posts: 532
Reputation: 4,147

Post » Sun Jul 16, 2017 9:53 pm

If you only plan to have that long earthquake for 8 seconds and that short seismic itch for 0.5 seconds at the same time .... Then a little workaround ... maybe ?

https://www.dropbox.com/s/q5jjpdd2dnthi ... .capx?dl=0

If the shake for the itch (in pixels) is smaller then the earthquake, you would not notice the itch anyway if they happen at the same time.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Return to How do I....?

Who is online

Users browsing this forum: Fenix18, Madsoggytoast, Yahoo [Bot] and 50 guests