Share your repls and programming experiences

← Back to all posts
Space Runner (Please look, I barely have any upvotes)

I made a runner for the game jam. The controls are in the game, just scroll down.

I made the game with html, css, and javascript.
Please comment to tell me if you like the game/have any suggestions.
Click to open (works best in a new tab).
My code is here.

If everything blurs when you start (happens occasionally on edge), that means the background is still loading (and the loading screen still went away for some reason). Wait a bit, and the background should load. Then everything will look normal again.
Also, it's 4K (if 4000 by 2000 is 4K).

Please give me suggestions on what to add next (I have no idea myself).


The history might look a bit weird, I did half the work in my project called "stuff" and then moved it to where it is now, in the project "Space Runner". I copied it over on April 16th I think, I don't know if the history will go back past then because I download the zip from my other project and uploaded it to the new one.


It isn't done, I'll be adding more stuff.


This is a very good game but the sound effects could change a little but overall it is a super good game.




This is so awesome!! Really liked the effort you put into the design, it looks great.


Thanks! What should I add next (You beat the game at 50,000)?
Also, click one of the links and watch my redirect animation.


I had a look at the code, I'm interested why you used functions for the majority of what could have been done with classes, I may be very wrong but from what I understand classes would be better. Also, you use

where let or const would be better
The game itself is very good, although i would say the movement is a little sluggish, I don't know if that's intentional but it stopped me from playing after I died.


@bearbearmo I'll turn up the movement speed a bit.
Also, classes are just "special" functions.

Also when you die, press 1 to continue.


classes are nice functions, personally I prefer them, I was wondering if there was a specific reason for not using them but if not that's fine


I just added a boss at 15,000!

I also stopped the arrows and space from scrolling.

You can also pause now!


Great game ! Graphics are nice, and I have some questions to ask you :
How did you make the background move ?
How do you make to put some image for your charachter and to make them move ?
How did you make to have a little ship as tab picture (default is a document paper, do you see what I mean ?)
How did you add some sound effects ?
This is a very good game, but I play on a french keyboard (azerty), so it would be nice to add an option to control the ship with arrows.


@Equation, I just added a link to my code, so you can look at what I did. I also just added arrow controls.

I made the background move on lines 338-345 (look at background.jpg and stars.png to understand how to prepare an image). I looked for a seamless image and tiled it twice horizontally, and subtracted from the x every frame. When the x was less than the negative canvas width (-2000), I set the background's x to 0.

I drew the images using cxt.drawImage(image, x, y);
I made it move by just changing a variable I'm using for the x and y position.
I created the images with 2 lines of code:
var name = new Image();
name.src = "file location";

I changed the tab icon with this line:

<link href="file location" rel="icon">

I added the sound effects like this:
var name = new Audio("file location");
To play the audio:;
To make the audio loop:
name.loop = true;


@GameMaster1928 Thank you very much !


@Equation, I've made a lot of improvements in the last 10 days, try my game again!


it's abit slow you should create ergonomic keyboard key