You are browsing as a guest. Sign up (or log in) to start making projects!

Space Game

  • 3 Devlogs
  • 17 Total hours

Solar System Game with simple design and features

Ship #1

The concept behind this game is simple but intense: You are a lone captain piloting a starship through a high-stakes sector of space. Your mission is to intercept and extract cosmic data from various planets in the solar system. The catch? The deeper you go, the more the universe tries to wipe you out with an absolute barrage of rogue meteors.

Play it right in your browser: https://solar-systemgame.vercel.app/
Peek under the hood: https://github.com/Rishi-Rahul/Solar-System-game

How it Works (The Technical Stuff)

I wanted this game to feel incredibly snappy, whether you’re playing on a massive desktop monitor or tapping away on a phone screen during a break. Here is how I put it together using just raw HTML5 Canvas and vanilla JavaScript:

Silky Smooth 60fps Rendering
To keep the game looking crisp on high-end mobile screens and modern monitors, I hooked into window.devicePixelRatio. Instead of letting the browser stretch a blurry canvas, the game dynamically resizes its internal resolution to match the exact physical pixels of your screen.
I also anchored everything to a base resolution of 800px using a global scale multiplier. This means whether you play on a tiny phone or a giant monitor, the game scales perfectly and the difficulty stays the same.

Drifty Space Physics
Instead of making the ship move instantly when you press a key (which feels robotic), I wrote a quick vector physics loop with built-in momentum.
When you press WASD or drag your finger on a screen, you aren’t moving the ship’s position directly—you’re adding acceleration to its velocity vector.
When you let go, a friction variable gently slows you down. This gives the ship that authentic, slippery “drifting through zero gravity” feel.

Procedural Chaos
To keep the game lightweight and lightning-fast to load, there are zero image files. Everything is drawn on the fly using math:
The Meteors: Every single meteor is a unique, randomly generated polygon. The code picks a random number of sides and jag the edges so no two space rocks look exactly alike.
The Neon Glow: I used canvas radial gradients and shadowBlur layers to make the Sun and target planets look like they’re practically melting through a retro CRT monitor.

Features Cooked In
Hybrid Controls: Supports arrow keys, WASD, or seamless touch-and-drag mechanics for mobile pilots.
*Escalating Threat Levels: The further you survive, the faster the planets orbit and the tighter the meteor waves get.
Dynamic Targeting: Your target planet gets an animated, high-contrast dashed orbit path so you know exactly where to fly.
*Retro CRT Scanlines: A clever CSS linear-gradient trick overlays a vintage, arcade-cabinet grid over the entire screen.

  • 3 devlogs
  • 17h
Try project → See source code →
Open comments for this post

35m 48s logged

Fix all errors with the planetspeed, they are normal now, and as you progress, it gets faster

2
Original post
@Ris2043

Fix all errors with the planetspeed, they are normal now, and as you progress, it gets faster

Replies

Loading replies…

0
19
Open comments for this post

7h 51m 35s logged

Added Key elements to the project, planet speed gets faster as you progress, and meteor amount increases as you progress too!!!

1
Original post
@Ris2043

Added Key elements to the project, planet speed gets faster as you progress, and meteor amount increases as you progress too!!!

Replies

Loading replies…

0
18
Open comments for this post

8h 42m 46s logged

I’ve finished the whole game itself, need to fix some bugs like the planet speed.

2
Original post
@Ris2043

I’ve finished the whole game itself, need to fix some bugs like the planet speed.

Replies

Loading replies…

0
33

Followers

Loading…