2026Web

Shadow Ninja - 2D Action Platformer

A 2D silhouette ninja action-platformer built from scratch in C++ and OpenGL, with no art, sound, or font assets at all - every character, enemy, particle, and world is drawn procedurally in code. Five atmospheric worlds, an eleven-joint animated ninja, fluid movement (double-jump, air-dash, wall-jump), katana-and-shuriken combat with a chakra Ultimate, six enemy types, and a boss, all in one standalone executable.

Shadow Ninja - 2D Action Platformer - Web project by Kalana Sandakelum

Shadow Ninja is a 2D silhouette action-platformer I built from scratch in C++ and OpenGL. You run, leap, double-jump, air-dash, and wall-jump through five atmospheric worlds, throwing shurikens and slashing with a katana, charging a chakra meter to unleash an invulnerable Ultimate, smashing breakable walls for gold, and finally fighting the Crimson Shogun. The twist that defines the whole project: there is not a single image, texture, sound, or font asset file anywhere. Every character, enemy, particle, and backdrop is drawn procedurally in code, and the entire game ships as one self-contained executable.

That "no assets" constraint shaped everything. The art is fully procedural vector graphics, built from filled polygons, triangle fans, gradients, and additive-blended glows rendered in immediate-mode OpenGL. The ninja itself is an eleven-joint skeleton driven by hand-keyframed animation clips: forward kinematics builds the pose each frame, the limbs are drawn as tapered black capsules with a head-wrap cloth, a waist sash, and a back-mounted katana, and a faint accent-coloured rim-aura lifts the black silhouette off the dark scenery. It animates through idle, run, jump-rise and jump-fall, a double-flip, dash, throw, slash, hurt, death, and victory states, with squash-and-stretch on every jump, land, and dash.

Behind the art is a small custom engine. It runs a fixed sixty-frames-per-second timestep, and each tick walks a clear pipeline: input, then the player's movement and combat, then enemy AI, projectiles, collisions, hazards, pickups, particles, the camera, and finally state transitions. Collision is axis-separated swept AABB with sub-stepping so nothing tunnels through walls at high speed, one-way platforms only block from above, and a state machine carries the game from the menu through level intros, play, and level-clear screens to the final victory. A side-scrolling camera follows the player with smooth easing and a decaying screen-shake.

A lot of care went into how it feels to move. Running is acceleration-based with friction, the jump has variable height, and there is a double jump, an air dash with after-images and brief invincibility, and wall-slide and wall-jump. It has the modern platformer niceties that make controls feel fair: coyote time, so you can still jump for a moment after walking off a ledge, and jump buffering, so a jump pressed just before you land still fires, plus a shrink ability to squeeze through low tunnels.

Combat is built around three tools and a meter. The shuriken is a straight, long-range throwing star that can be aimed with the mouse, the katana is a visible swept slash with a glowing crescent trail, and the Ultimate is a chakra-fuelled, invulnerable high-speed dash-slash that cuts through every enemy and wall in its path. The chakra meter fills as you land hits and kills, hits briefly stagger enemies to create breathing room, and a kill-streak combo raises a score multiplier that breaks the moment you take a hit. The player has health and lives, with brief invincibility and knockback after being hit.

There are six enemy types, each with telegraphed attacks: a patrolling sword stalker, a ranged kunai archer, a dashing shadow assassin, a heavy hammer brute with a travelling ground shockwave, a one-hit spider mine that explodes, and the Warlord boss, a three-phase fight with directional red telegraphs and summoned minions that ends the game on its death. The five worlds escalate in difficulty and each has its own hand-tuned palette, from a misty bamboo forest through fiery mountains, moonlit ruins, and a violet twilight to an apocalyptic volcanic boss arena, all layered with parallax silhouettes, fog bands, and drifting ambient particles. Between you and the end are spikes, oscillating saw blades, instant-kill lava, telegraphed fire-jets, and moving, crumbling, and one-way platforms, with checkpoints so a fall never ends the run unless your lives do.

The game leans hard into "juice." Kills and the finale trigger hitstop and slow-motion, the screen shakes, particle systems throw additive glows and flat shards, and damage and combo numbers float off enemies. Clearing a level plays a victory choreography: a backflip into a heroic salute, rising gold embers, and a stats card that counts up your gold and pops a one-to-three star rating based on how much you collected and whether you died.

The whole thing is a single C++17 source file of roughly two thousand lines, statically linked into one standalone executable that depends only on system libraries. It was built design-first, with a master spec defining the palettes, the skeletal-animation keyframes, the enemy stats, and the level layouts, then implemented and screenshot-verified stage by stage, with an adversarial review pass that hunted down bugs like enemies falling through floors and an impossible wall-jump section. Shadow Ninja is the project where I learned how much character you can squeeze out of pure code: a complete, juicy action game with no art pipeline at all, just maths, polygons, and a lot of tuning.

Built with

C++17OpenGLfreeglutGLUTMinGW / g++procedural vector graphics

More work

All projects