How do I Zoom near of the edge of room zone.

0 favourites
  • 4 posts
From the Asset Store
On the Edge is a puzzle game where you have 40 levels to have fun with.
  • Hello To everyone!!

    This is my first post.

    I wondered if anyone can help me with my game, it's a metroidvania based game i'm stuck with a zoom problem maybe you guys can guide me.

    I have a big layout divided by rooms (RoomZones).

    When the player is near on the edge of the roomzone and gets zoom looks like this.

    This is actually my camera for the player (ScrollX/Y to the player but keep them within the boundaries of the current RoomZone).

    Scroll To

    X: clamp(Player_Base.X, RoomZone.X + RES_WIDTH / 2, RoomZone.X + RoomZone.Width - RES_WIDTH / 2)

    Y: clamp(Player_Base.Y, RoomZone.Y + RES_HEIGHT / 2, RoomZone.Y + RoomZone.Height - RES_HEIGHT / 2)

    How do i limit the zoom on the edge of the roomzone?

    Any thoughts?

    Thanks!!

  • Set Unbounded Scrolling to yes.

    Make your own bounding with clamp.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the reply,

    Can you be more specific with the "bouncing with clamp", please

  • Thats what this does.

    Scroll To

    X: clamp(Player_Base.X, RoomZone.X + RES_WIDTH / 2, RoomZone.X + RoomZone.Width - RES_WIDTH / 2)

    Y: clamp(Player_Base.Y, RoomZone.Y + RES_HEIGHT / 2, RoomZone.Y + RoomZone.Height - RES_HEIGHT / 2)

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