specific scrolling

0 favourites
From the Asset Store
Change the size and position of everything without calculating anything!
  • damn, somehow I can't make it work.

    This is what I've done.

    My player sprite is called PLAYERBOX and the scrolling sprite is called SCROLLY

    I set this event:

    PLAYERBOX on collision with SCROLLY/PLAYERBOX platform is moving =

    lerp(CanvasToLayerY(0, WindowWidth/2, WindowHeight/2), PLAYERBOX.Y, 0.05)

    To all that I added an everytick event to scroll X to playerbox X

    What happens is that once the playerbox touches the scrollY the screen scrolls a little to the downside and stays there. it also does it instanctly, no transition. If you get out of the collision area and enter again this happens again, so every time you do it the screen goes lower.

    I've tried taking out the platform condition but nothing changed. I've also tried replacing the PLAYERBOX element in the expression with the SCROLLY but still doesn't work.

  • So first off I would say you might want to change the:

    PLAYERBOX | On collision with SCROLLY


    PLAYERBOX | Is overlapping SCROLLY

    I believe that On collision with is only a single event, so you would only get one step out of the lerp expression. The Is overlapping will act like an every tick event as long as you are overlapping the object.

    Next I'm wondering if your statement:

    ...PLAYERBOX platform is moving = | lerp(CanvasToLayer(0...

    is a typo or not. Did you really mean to type:

    ...PLAYERBOX platform is moving = || System | Set Scroll Y to lerp(CanvasToLayer(0...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • you're right!

    the problem was the collision condition.

    now, regarding the PLATORM IS MOVING condition, the problem is that if you stand still and jump (without going forward), the scrolling will still happen. I've tried changing it for "compare speed" but it doesn't discern between X or Y speed. the ideal would be to replace the PLATFORM IS MOVING with something like: "sprite X speed is not zero". Any ideas?

  • Here you go:

  • great!

    I even managed to make the scroll X work only when walking right by creating a sprite that follows the position of the player but only if it walks right. when the player goes left it leaves the sprite behind so it gives the illusion that the player "pushes" the scroll sprite. By making the screen scroll to that sprite it gives the same sensation of contra, where you can go right but the screen won't follow if you go left.

    now I want to see if i can do the same but with zoom. I mean, make the layer go smaller progresivelly as you advance. Just the same thing you helped me with regarding the Y scroll but with zooming. But I think I'll create another topic on that in case i can't pull it off.

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