How do I shake objects or camera without Unbounded scrolling

Get help using Construct 2

Post » Wed Apr 13, 2016 5:42 pm

Hi. I wanted to add some camera shake effects with "Scroll To" Behavior but I wondered if it is possible to shake the screen without enabling "Unbounded scrolling".
With my current layout its not nice to have a big black border around and I use the Warp behavior for the player. Can you shake the camera with other actions or move the whole screen around?

And is there an easy way to shake single objects instead of the whole screen, too?
B
53
S
16
G
6
Posts: 718
Reputation: 9,150

Post » Wed Apr 13, 2016 6:02 pm

I had the same problem several times - and I didnt found a solution yet.

You might create a 1x1 px sprite, center it in your layout (just do layout.X/2 and layout.Y/2) and give it the ScrollTo behavoir. In order to shake, you have to "show the borders". You could also zoom as the ScrollTo sprite as the center (zoom in about 5% or something) and then shake; after the shake zoom back.

Regards,
Proxy
B
24
S
14
G
9
Posts: 118
Reputation: 6,794

Post » Wed Apr 13, 2016 6:04 pm

Have a look at this:
viewtopic.php?t=87207&start=0
ImageImageImage
B
71
S
21
G
221
Posts: 3,649
Reputation: 124,227

Post » Wed Apr 13, 2016 10:25 pm

Someone also made a behavior for shaking objects.

behavior-shake-not-camera_t166389?&start=10&hilit=shake
B
83
S
40
G
15
Posts: 987
Reputation: 16,847

Post » Thu Apr 14, 2016 6:04 am

Thanks! I just added a invisible / empty sprite in the Center of the layout and applied the Scroll To and Shake action to it. Seems to work fine even with the default plugin. :)
B
53
S
16
G
6
Posts: 718
Reputation: 9,150


Return to How do I....?

Who is online

Users browsing this forum: Manubis, Ryan Kocourek, TheSupreme, TylerJS and 10 guests