Skip to content
← Back to Community
Space Runner (Please look, I barely have any upvotes)
Profile icon
[deleted]

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).

NOTES TO JUDGES:

The history might look a bit weird, I did half the work in my repl.it 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.

Voters
Profile icon
Antonio1918
Profile icon
Nugget521YT
Profile icon
NotScovay
Profile icon
17HarshaN
Profile icon
SterlingNeal
Profile icon
bchian316
Profile icon
ImagineLosing
Profile icon
Firestorm8
Profile icon
Soccer135246
Profile icon
lightningrock
Comments
hotnewtop
Profile icon
[deleted]

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

Profile icon
Nugget521YT

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

Profile icon
ngelAlbiol

molaaaa

Profile icon
GabrielaPalla

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

Profile icon
[deleted]

@GabrielaPalla

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

Profile icon
bearbearmo

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

var

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.

Profile icon
[deleted]

@bearbearmo
I'll turn up the movement speed a bit.
Also, classes are just "special" functions.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes

Also when you die, press 1 to continue.

Profile icon
bearbearmo

@GameMaster1928

This file cannot be displayed: https://storage.googleapis.com/replit/images/1555327310785_549a69f9bbeb78fca5fefe423ad2beca.pn
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

Profile icon
[deleted]

I just added a boss at 15,000!

I also stopped the arrows and space from scrolling.

You can also pause now!

Profile icon
Equation

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.

Profile icon
[deleted]

@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:

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

Profile icon
Equation

@GameMaster1928
Thank you very much !

Profile icon
[deleted]

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

Profile icon
ThomasLairy

it's abit slow you should create ergonomic keyboard key