Going from Right to Left

  • I'm working on a game idea that involves the screen scrolling from right (beginning of the level) to the left. This is similar to how the Balloon Trip mode works in Balloon Fight for NES.

    I'm not sure how to accomplish 2 things in particular:

    1) Keep the player from going out of camera view on the extreme left or right of the game viewing screen

    2) Having a GUI on the screen that doesn't move while the game goes from right to left; I have no problem with this having the screen go from left to right

    Other game mechanics seem fine. Any help would be appreciated.

  • There are two main ways to set up this sort of game, and the answer kind of depends on which method you use.

    a. Is the entire level created ahead of time and you're actively scrolling and moving through it? There are a few ways you can keep the UI in place, including the viewport expressions, anchor behavior, and layer parallax. Using the same idea of holding your UI in place, you can also place invisible helper sprites that define the edges of your screen. Those would be solid to prevent your character from moving through them, or maybe push out solids using custom movement with the character having the solid behavior.

    b. Does the character and viewport actually stay still and the objects/stage generated off the edge of the viewport and move past the character? See the space shooter template for this type of setup, I'd recommend this if you're trying to emulate Balloon Trip.

  • There are two main ways to set up this sort of game, and the answer kind of depends on which method you use.

    a. Is the entire level created ahead of time and you're actively scrolling and moving through it? There are a few ways you can keep the UI in place, including the viewport expressions, anchor behavior, and layer parallax. Using the same idea of holding your UI in place, you can also place invisible helper sprites that define the edges of your screen. Those would be solid to prevent your character from moving through them, or maybe push out solids using custom movement with the character having the solid behavior.

    b. Does the character and viewport actually stay still and the objects/stage generated off the edge of the viewport and move past the character? See the space shooter template for this type of setup, I'd recommend this if you're trying to emulate Balloon Trip.

    It's definitely method A that I'm going for. I have it setup so that when the player presses a key, the camera object scrolls to the left and the player can't go past the viewing window while dodging obstacles in the game world.

  • Pin two helper objects on either side of your camera object at the left and right edges of your viewport. Where your camera goes, these boundary objects will go too, and make them solid so your player can't go through them.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Pin two helper objects on either side of your camera object at the left and right edges of your viewport. Where your camera goes, these boundary objects will go too, and make them solid so your player can't go through them.

    OK, I was able to get this working properly. My concern was having things not move at the right pace but it's fine for the game right now. Thanks a lot for the idea.

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