How to create a camera shake with Unbounded scroll (solved)

0 favourites
  • 9 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • Hi guys

    I wanted to know how to create a camera shake in a 940x640 windows size,layout and margin...

    i am not using unbound scrolling,

    Because when i use it the screen goes messed up :O

    EDIT:

    i solved the problem so i will tell you how i did it...

    So my layout is 960x640 and i'm making a runner like the Construct 2 template and i want to create a camera shake, what i did was

    Set unbounded scrolling to YES

    Create a square sprite in any place

    set an every tick that says -- > Every Tick -> Square set position to LayoutWidth /2 and LayoutHeigth /2

    Then set Scroll To Behaviour to the SQUARE (not the player)

    After that set your trigger,

    i used "Character on land" ---> shake 1 second

    Hope it helps, for my example it worked...

  • A few thinigs a learned about screen shake. I assume you know about the shake action available for a sprite that has the behavior scroll added to it. If not then that's where you find it .. how ever things i found are that the screen will not shake if the viewport is to close to the edge of the layout. Took me a few times to understand why but then i figured (face-palmed more like it) the screen cant possibly show me and area that does not exists which is what would happen if the screen wanted to shake but the viewport is right up to the edge of the layout. You will need your layout to be bigger but prevent the viewport from scrolling to the edge leaving just enough room that if you shake the screen the viewport has some wiggle room on the layout.

  • So, which one should i increase? the layout size,margin or window size?... also i suppose the screen shake goes on the character...

  • leomachado666 So the window is what the user sees. Everything beyond it on the layout is out of view... for it to shake the window needs to have viewable area on the Layout on all sides. so inrease your layout size to something larger than the window size. Then make sure your window/view port never gets to close to the edge of the layout. this way when you want the window/viewport to shake there is avaiable layout for it to show on all sides.

    Sorry this crood mock up but it will help to visualize it.

    [attachment=0:g3m92phw][/attachment:g3m92phw]

    Your window is what shakes. It needs available space on all sides to move.

  • If you have trouble with shake at the edge of the screen, you can have a look at my modified plugins:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • blackhornet - Really nice plugin!... takes the guess work out of it. He will still need a larger layout but wont have to worry about scrolling to edge now.

  • troublesum

    I'm setting the layout to 960x640

    margings 950,630

    Windows size 930x610

    On player landed, shake 1 second...

    but it doesn't work

  • leomachado666

    Is your window (viewable area) located on the very edge of the layout when you attempt to shake? When you shake the window attempts to move a few pixels in all directions. If your window is located directly on the edge of the layout then there are no available pixels to show and it will prevent the window from shaking.

    Here made you a quick example. When I set scroll enabled to the blue sprite the window moves to the center of the layout becuase thats where the prite is. this leaves room on all sides of the layout for the window to shake. Click the blue sprite to shake.

    [attachment=0:2db08nix][/attachment:2db08nix]

  • Te thing is i need to do it with a 960x640 layout :/

    edit:

    Problem solved

    I will edit the first post with the solution!!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)