Page 1 of 1

How would I go on about creating an endless runner game?

Posted: Fri Aug 24, 2018 10:11 am
by Gwardord
Hello guys.

I've been playing around with the LOVE framework for a week or so now and I've been wondering how would I make an endless runner game? So far I've figured out this much:

-The player is a still character that can only jump and dies if it collides with an obstacle.
-The terrain which the player runs on is also still.
-The score system starts at zero and is tied to the distance (time) the player has ran. If the score is greater than the current highscore (which too starts at zero) it overwrites the former highscore and saves itself.

What I however am struggling with is the randomized placement of the obstacles and pickups (which grant you bonus score).

How would I begin with that that the game randomly generates obstacles on the edge of the screen and makes them move at increasing velocity?

Also that the game doesn't generate too many of them making a wall of obstacles that is impossible to dodge?

Thanks to anyone who decides to help or even attempts to do so!

Re: How would I go on about creating an endless runner game?

Posted: Fri Aug 24, 2018 1:52 pm
by sefan
Welcome.

One way to start building this is to create like 3 non random obstacles outside of the screen whit a gap between them and then move them. When then obstacles goes outside of the screen you teleport the obstacle to the other side.

This way you have obstacles that are constantly moving in X-axis and when you teleport them you can resize them and move them in Y-axis.

Random resize and random Y-axis spawn point should be controlled random. So you know the objects don't become to big or spawn in bad places. Velocity could for example be change based on time or score.

Re: How would I go on about creating an endless runner game?

Posted: Fri Aug 24, 2018 4:17 pm
by zorg
Would it be a side-scroller or one of those pseudo-3D games where the obstacles come "towards" the screen? Because it matters.