Screenshake problem

0 favourites
  • 12 posts
  • https://www.scirra.com/manual/102/scroll-to

    I read that scrollto's screenshake action WILL ONLY WORK if:

    • window size the size of the layout must be bigger than the size of the window

    OR

    • the layout's Unbounded scrolling property must be set to Yes.

    My problem is that I my window size is the same as the layout size (so no scrolling is needed) and I can't set Unbounded Scrolling to Yes because I have extra parts of the BG outside the layout and also if set to yes, if my player walks to the extreme right, the left part of the screen will only show the lifebar (on a layer with no scrolling) so no backgrounds is shown on left part.

    I have a camera object (invisible and always set to player's position)

    Any way to work around this restraint of scrollto? or how to code a manually coded shake?

    Please help. thanks.

  • You could have a Global variable, say Shake and when you need to shake the screen just do something like this:

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

  • You could have a Global variable, say Shake and when you need to shake the screen just do something like this:

    [attachment=0:3hk6510b][/attachment:3hk6510b]

    Somebody

    thanks but that is more of a zoom not a screenshake. I need screenshake (given that I cannot change my 2 situations that violate the stated 2 restrictions of scrollto)

  • Shake demo

  • Shake demo

    Lordshiva1948

    I might be asking too much but...

    can you give me a screenshot of events? I can't install anything here (not my pc) and I don't have r192 of C2 here yet.

    Thanks.

  • Lordshiva1948

    ok I made a workaround to make me able to open the file in my current C2 version

    You're not exactly helping me with my problem. You got my hopes up for nothing. LEARN TO READ THE FIRST POST.

    I said

    My problem is that I my window size is the same as the layout size (so no scrolling is needed) and I can't set Unbounded Scrolling to Yes because I have extra parts of the BG outside the layout and also if set to yes, if my player walks to the extreme right, the left part of the screen will only show the lifebar (on a layer with no scrolling) so no backgrounds is shown on left part.

  • Sorry I do apologies miss understood.

  • You can try my alternate plugins for the shaking.

    For shaking at the edges to work, you MUST have a layout bigger than the window. Shaking works by scrolling pixels that are outside pf the window, into the window, so there have to be pixels there in the first place. My plugins help here as they offset the layout so that there are always pixels around the edge that can be shaken into view, while locking the view as if the window=layout size.

  • blackhornet

    thanks.

    Just a few questions though:

    1.

    window size is 640,480

    1 of my layouts is 640,480, so I changed it to 740,580

    my insets are:

    left = 0

    top = 0

    right = 100

    bottom = 100

    I did not change the positions of the objects in my layout, just changed layout size

    are the values for inset correct? Not sure I understand them that's why I am asking.

    2. I noticed that there is no disable/enable for scroll to plus. There are situations where in a long layout, you fight goons until you reach the final boss on (right) end of layout, I want to make the scroll to stay in that position. So I just set position of camera to something not moving? or is there a more correct/better way of doing it?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 1) set them all to 50, that gives you 50 pixels around the whole layout - you'll need to shift everything in and down by 50 pixels. (You don't need that much room. The shake is generally only a few pixels.)

    2) I've used a separate invisible camera option in the past. It can be pinned to the player, and then unpinned at the appropriate time to hold the screen.

  • blackhornet

    ok. thanks.

    there is a problem for a layer with a 70,70 parallax parameters

    how should I assign my parallax layer objects?

  • You can adjust the numbers by 30%. So in my example, using 64 bit border, I set top/left to 45 (64 - 64*.3) and bot/right to 83 (64 + 64*.3).

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