Asteroid Destroyer banner

Asteroid Destroyer

6 devlogs
26h 29m 13s

A space-themed arcade shooter built from scratch with Vanilla HTML, CSS, and JavaScript — no frameworks, no dependencies, just pure web code.

This project uses AI

I used AI to correct the mistakes i made through JavaScript writing,
for code commenting, to know about how to start a repo, commit and commit messages are also generated by AI Even though I commit manually.
Repo README also generated by AI

Demo Repository

Loading README...

dinithayehan

Shipped this project!

I built a space shooter from absolute scratch using just HTML, CSS, and JavaScript — no game engine, no framework, no tutorials telling me exactly what to type. I started with a cyan box that could slide left and right and somehow ended up with a 60FPS canvas game with two enemy types, particle explosions, a level system, mobile touch controls, and an auto-shoot mode — deployed live on GitHub Pages.

The hardest part honestly wasn’t just the game. It also was Git too. I kept messing up branches, overwriting things, and staring at error messages I didn’t understand. I almost gave up on pushing it public. I used AI to get through the Git side of things and to help debug my JavaScript when I got stuck — this was my first time writing JS, so there were a lot of moments where I just didn’t know why something wasn’t working. But I figured it out, and the game is live.

If you want to check it out: dinithayehan.github.io/AsteroidDestroyer

Really happy with how it turned out

dinithayehan

Final Version — AsteroidDestroyer (Canvas Optimized) — Deployed! 🚀

What I worked on:

This is the one I’m most proud of. I rewrote the entire engine using HTML5 Canvas and a requestAnimationFrame game loop — no more DOM divs flying around. The ship, asteroids, UFOs, bullets, and particle explosions are all drawn in pure JS math every frame. This was also my first real experience writing JavaScript, so it took a lot of time to figure out, but I got there.

The result: a smooth, lag-free 60FPS game that stays fast even with tons of enemies on screen. Features include two enemy types (asteroids + zigzag UFOs), particle explosions, auto-shoot toggle, mobile touch support, and infinite level scaling.

The Git & GitHub struggle:

Honestly — Git almost broke me. I kept mixing up branches, overwriting things, and didn’t understand half the error messages. I used AI assistance to get through it, and I’m not embarrassed about that. The AI helped me understand why each command existed, and suggested structuring the commits as a version-by-version story. I thought that was a genuinely smart way to document progress.

Go try it!

🕹️ Play it here → dinithayehan.github.io/AsteroidDestroyer

A gameplay video is also here.

Honest thoughts:

It’s more intense than I expected — level 4+ gets chaotic fast. Auto-shoot turns it into a pure dodge game which feels totally different. UFOs might be a bit too punishing at high levels, but the thruster flame flicker is a detail I’m keeping.

What’s next:

This is deployed but not FINISHED.
Ideas:
highscore screen, wave mode, sound effects, local leaderboard, maybe an online one.
Drop suggestions in the comments or open a repo issue — genuinely open to ideas.

0
dinithayehan

Today was a bigger game-design day because I added combat and basic game progression. I built a start screen, added lives, and then made the player able to shoot bullets upward instead of only dodging obstacles. I also connected bullet collision with asteroids, so now the player can destroy threats instead of just surviving them. On top of that, I added a difficulty increase over time by making the asteroid speed rise gradually, which made the game feel more serious and less predictable. This version felt like a major jump because the game changed from an endless dodging prototype into something closer to a real arcade survival shooter.

Attachment
Attachment
Attachment
0
dinithayehan

I focused on making the asteroid game feel more alive and more polished. I replaced the plain shapes with emoji-style visuals like a rocket for the player, asteroids for obstacles, and an explosion effect for collisions. I also added a moving star background so the game feels more like flying through space instead of playing inside a plain black box. Another thing I worked on was touch support, so the game can be moved on mobile too and not only on keyboard. This version felt important because I was no longer just making the logic work, I was starting to care about presentation and player experience too.

Attachment
0
dinithayehan

So after the first setup it was all about turning the static layout into an actual game loop. I added keyboard movement so the player can move left and right, then I built falling asteroids that spawn automatically and move down the screen over time. After that, I added collision detection between the player and the asteroids, plus a score system that increases whenever an asteroid successfully passes by. This was the first version that actually felt like a game instead of just a design mockup. The biggest win for me was seeing the score update live and then getting a proper game over when the collision logic finally worked.

Attachment
0
dinithayehan

Today I did almost finished the project and i almost forgot to update with the devlog. So I am going to fine-tune and update you all with what i did as the steps. To begin,today was mostly about building the very first base for my asteroid game. I started by setting up the main HTML structure for the play area, the player block, and the asteroid block so I could finally see the game layout on screen instead of just imagining it. I also spent time figuring out how to center the game area and make the page feel like a small space-themed arcade screen. Even though this version is very simple, it was important because it gave me the base structure that every later version could build on. Seeing the player and asteroid elements appear inside the game box felt like the first real proof that the project had started

Attachment
0