Screen shake help

Get help using Construct 2

Post » Mon Mar 25, 2013 6:03 pm

Hi C2'ers,

I wanted to introduce a screen shake to my game, but have hit a problem. I've tried using the shake feature of the ScrollTo behaviour, but unfortunately this doesn't seem to have worked for me.

I'm guessing that it's because my layout is the same size as my window, so it's a set size and does not scroll (so there's no where to "ScrollTo").

Can anyone offer some advice on another way I could achieve this, given the restrictions mentioned above.

Thanks for any help or advice you can offer.
B
18
S
4
G
2
Posts: 77
Reputation: 1,588

Post » Mon Mar 25, 2013 6:45 pm

You can turn on 'unbounded scrolling' on the layout, make the background a bit bigger than the layout, put an invisible object in the middle of the screen with 'ScrollTo' behavior and call the shake action on that.
B
54
S
28
G
18
Posts: 1,520
Reputation: 24,990

Post » Mon Mar 25, 2013 8:00 pm

Hi @ramones,

Thanks for the information, it was very useful. I gave it a a try and it works, fantastic!
B
18
S
4
G
2
Posts: 77
Reputation: 1,588

Post » Wed Jun 12, 2013 3:01 pm

@ ramones

Great info, very helpful!

B
26
S
11
G
2
Posts: 669
Reputation: 5,038

Post » Tue Mar 25, 2014 1:41 pm

Thanks, this post really helped.
B
25
S
10
G
3
Posts: 154
Reputation: 2,838

Post » Tue Apr 22, 2014 8:11 pm

This is great :)
Except for: "....and call the shake action on that".

i don't know what to do on this point - i simply don't understand it 100%:
what i maybe understand is, that i need to to call "it" (exactly what?) on the action, which defines the shake?? (which i already defined)
=>> okay, i found it out myself. just as you said. just define the action on the event you defined for shaking (select the object with the scrollTo Behaviour and you'll see it ^^)


but now i have another problem: i center the image with scrollTo... but now my whole images aren't centered -> they are moved :(
and the solution: as i though, i just centered the image the wrong way (it wasn't centered at all) ;D
B
5
Posts: 18
Reputation: 263


Return to How do I....?

Who is online

Users browsing this forum: amarcelo, Draconinho, LeFuji, totoe and 18 guests