How to shake a sprite?

Get help using Construct 2

Post » Sat Jun 02, 2012 8:37 am

I'm wondering how to shake a sprite, not like shake screen, just only a sprite.


My idea is:
Every Tick: Set position to:
X: random(100,200)
Y: random(100,200)

But it only needs to coordinate on the layout, i would like to have an alternative code that doesn't need to coordinate on the layout, do you have an idea?

Thanks!
B
96
S
33
G
29
Posts: 3,137
Reputation: 28,130

Post » Sat Jun 02, 2012 9:24 am

http://dl.dropbox.com/u/44710358/shake.capx

maybe this will help
B
103
S
25
G
41
Posts: 1,877
Reputation: 32,397

Post » Sat Jun 02, 2012 2:23 pm

It's useful to me too, thank you @delgado
B
124
S
31
G
17
Posts: 1,491
Reputation: 20,056

Post » Sat Jun 02, 2012 3:21 pm

Another "shake" example without sine behaviour_

Capx
B
21
S
6
G
8
Posts: 1,215
Reputation: 7,881

Post » Sat Jun 02, 2012 3:57 pm

i look into @chrisbrobs example and i wondering how to hell this works :)
delgado2012-06-02 15:57:20
B
103
S
25
G
41
Posts: 1,877
Reputation: 32,397

Post » Sat Jun 02, 2012 4:17 pm

[QUOTE=delgado] i look into @chrisbrobs example and i wondering how to hell this works :)
[/QUOTE]

I just added more frames to the animation and moved the origin point slightly on each frame....then set it to loop.
B
21
S
6
G
8
Posts: 1,215
Reputation: 7,881

Post » Sat Jun 02, 2012 4:29 pm

Tricky ^^
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
270
S
98
G
70
Posts: 7,267
Reputation: 75,644

Post » Sat Jun 02, 2012 8:33 pm

Thanks @delgado and @chrisbrobs! two .capx are useful :D
B
96
S
33
G
29
Posts: 3,137
Reputation: 28,130

Post » Thu Jun 14, 2012 12:26 am

Hey guys, I'm pretty new to this stuff. But ChrisBrobs technique of just moving the origin point for a few frames worked really well. Thanks!
B
2
Posts: 1
Reputation: 252

Post » Wed Sep 12, 2012 11:50 am

Deglado, sorry but your link is no longer available... could you please put it back again? Thank you!
B
18
S
3
G
3
Posts: 16
Reputation: 3,340

Next

Return to How do I....?

Who is online

Users browsing this forum: blackhornet, JoshSenpai, Solomon, WeariedCoffee2, Yahoo [Bot] and 11 guests