Yip
What it is
A side-scrolling space shooter. The world scrolls to the right while you fly a small ship inside the left part of the screen, firing at yellow enemies that shoot red shots back at you. You switch weapons with 1, 2 and 3 (normal, laser and triple; the laser still fires the normal shot), and Ctrl+E brings in a new enemy.
The top left keeps score: enemies beaten out of those that came, shots that hit out of those fired, and the enemy shots you took.
How it's built
I wrote it in C++ on SFML, and it now builds with C++23 on SFML 3.1 and kazilib, my own C++ library. The same code compiles to a Windows executable and to WebAssembly.
- Scenes and objects: a menu scene and a game scene on kazilib's scene manager; the player, enemies and projectiles are objects with their own colliders, and a debug mode draws each origin and collider.
- Aimed enemy fire: enemy shots are aimed at the player, taking the camera's scroll into account on the horizontal axis only, and move by the real time of each tick.
- A browser loop: in the browser the game runs one logic tick and one frame per pass, waiting for the browser's next animation frame, and reads held keys from SDL's keyboard state.
- A WebGL detail: the scrolling star field draws points, and WebGL only sizes points from the shader. The OpenGL emulation in kazilib never set that size, so the stars were invisible in the browser until I fixed it there.
- Tested end to end: a script plays the Windows build through the menu, the weapons and a beaten enemy, and a headless browser plays the live page until an enemy is beaten.
Timeline
I worked on it by hand between 2019 and 2022; in 2026 I moved it to SFML 3.1 and kazilib, fixed old bugs (collisions, score, player bounds, enemy aim) and, with AI help, put it in the browser.
Technologies
- C++23
- SFML 3.1
- kazilib
- WebAssembly
- WebGL2