How do I spawn objects out of layout in unbounded scrolling

Get help using Construct 2

Post » Wed Oct 22, 2014 11:16 am

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
B
8
S
3
G
2
Posts: 53
Reputation: 1,764

Post » Wed Oct 22, 2014 11:33 am

Spawn obstacles based on user position.

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

This will spawn objects just fine.
B
10
S
1
Posts: 56
Reputation: 654

Post » Wed Oct 22, 2014 12:10 pm

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 :)
You do not have the required permissions to view the files attached to this post.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, Google [Bot] and 28 guests