How do I spawn objects out of layout in unbounded scrolling

0 favourites
  • 3 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • I have no trouble spawning objects on the layout but when my player starts to go into the area of unbound scrolling( beyond the layout) all my objects stop spawning. What I mean by objects spawning is I have made it so an obstacle spawns every 120 y. What I need to find out is how to continue these objects spawning even when i am off the layout and unbound scrolling.

    Thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Spawn obstacles based on user position.

    Eg spawn object at y = Player.Y +500, Player.X +100

    This will spawn objects just fine.

  • Use the player's Y position to create your Obstacles. You can use the "random" expression for variation. For example.

    Every x seconds ----> Create object "Obstacle" at layer 0 , random(window.Width) [for the X axis] , random(player.Y - window.Height, player.Y - window.Height*2)

    Will create obstacles at random positions on the X axis (but within your viewport) and within a vertical area that spawns between the [(Player's current Y position) - (whatever Height in pixels your game has)] and [(Player's current Y position) - (whatever Height in pixels your game has * 2)].

    I know that in words all the above probably don't mean nothing so, here is a relative example.

    EDIT- funkyy is a ninja and answered first, but I had to carry the example with me

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