How do I Create Obstacles for an endless runner game

Get help using Construct 2

Post » Wed Feb 01, 2017 3:49 pm

Hello there!

Ive got a question about a good solution for spawning obstacles and coins on an endless runner game. So ive a ground the player is moving on and on this iam spawning obstacles but i want to have a fix coin spawning for special obstacles. So if there is a rock, the player has to jump over there should be - for excample - four coins ordered in a rainbow shape over the rock to suggest the player to jump over it. If this obstacle with its special coin shape is outside the screen it should reset the coins (if there where collected) and put them onto the same position above the obstacle.

Can someone help me out to find a solution - later i want to generate differend obstacle types with differend coin positions above the obstacles (it depends on what kind of obstacle iam spawning - but basically my intention of this post is to get the idea how to do that).

If youre knowing a tutorial or another post - please feel free to link it here :)


See the capx:
https://www.dropbox.com/s/8dobttnbxhudl ... .capx?dl=0

Thank you very much!
B
10
S
2
Posts: 157
Reputation: 1,086

Post » Wed Feb 01, 2017 7:03 pm

Personally I would handle this using image points on your obstacle objects. In each animation frame, add additional image points wherever you want coins to appear. When you spawn an obstacle, use a loop to iterate through the additional image points, spawning the coins :)
The LEVEL GENERATOR TOOLKIT



24 functions dedicated to producing randomly generated terrain for all kinds of games.
B
25
S
7
Posts: 245
Reputation: 2,314

Post » Wed Feb 01, 2017 7:53 pm

ImageImage
B
111
S
51
G
24
Posts: 787
Reputation: 23,394

Post » Thu Feb 02, 2017 9:20 am

Thank you for your answers - i will check your solutions out :)
B
10
S
2
Posts: 157
Reputation: 1,086

Post » Fri Feb 03, 2017 3:01 pm

@mrtumbles nice thing - never heared from image points but it works like a charm. Thanks for this hint :)
@alextro thank you too for your help
B
10
S
2
Posts: 157
Reputation: 1,086

Post » Fri Feb 03, 2017 8:35 pm

Have a good time exploring the example then. Hope you can achieve what you are looking for.
ImageImage
B
111
S
51
G
24
Posts: 787
Reputation: 23,394

Post » Sat Feb 04, 2017 1:47 am

every x second.. pick 1 - 5
if 1
then spawn obsctacle at top
if 2
then spawn obstacle at bottom..
and so on..
B
8
S
3
Posts: 46
Reputation: 708


Return to How do I....?

Who is online

Users browsing this forum: Hassan Hackmi and 6 guests