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

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Gwardord
Prole
Posts: 1
Joined: Fri Aug 24, 2018 6:44 am

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

Post by Gwardord » Fri Aug 24, 2018 10:11 am

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!

User avatar
sefan
Prole
Posts: 22
Joined: Fri Jul 31, 2015 7:03 am
Contact:

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

Post by sefan » Fri Aug 24, 2018 1:52 pm

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.

User avatar
zorg
Party member
Posts: 2509
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

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

Post by zorg » Fri Aug 24, 2018 4:17 pm

Would it be a side-scroller or one of those pseudo-3D games where the obstacles come "towards" the screen? Because it matters.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 7 guests