A 2D space combat engine built with Odin and Raylib.
FLYT is my version of a 2D fighter jet simulation I made to learn efficiency and clarity in Odin.
This is not my best work but I was sleep deprived when I made this. I just wanted to try out something simple.
If u find some issues please do make them seen.
The player controls a fighter jet navigating through an asteroid field, utilizing trigonometric vector calculation for flight orientation and projectile physics.
-
Procedural Movement
Vector-based flight mechanics with normalized diagonal velocity. -
Oriented Combat
Projectile spawning based on the jet's current rotational transform. -
Memory Pooling
Static allocation for bullets and asteroids to ensure zero-allocation game loops. -
Wrap-Around Topology
Asteroids utilize screen-wrapping logic to maintain a persistent play area. -
Linear Algebra Collisions
Efficient Euclidean distance checks for combat and damage logic.
The project is decoupled into distinct modules so i can later work on it and i dont usually write single file shit since i hate that kinda archs.
| Module | Responsibility |
|---|---|
| Main | Orchestrates the game loop (Input, Update, Render) and state transitions |
| Entities | Defines data structures for the Player, Bullets, and Asteroids |
| Math | Handles custom type definitions and linear algebra abstractions |
| Constants | Centralizes configuration, screen dimensions, and performance limits |
- Language: Odin (General-purpose, data-oriented, imperative)
- Graphics: Raylib (OpenGL abstraction)
- Math Library:
core:math/linalgfor hardware-accelerated vector operations - Memory Management: Explicit stack and package-level allocation; no garbage collection
- Install the Odin Compiler.
- Ensure Raylib is available (usually included by default in Odin's vendor library).
Navigate to the src directory and run:
odin run .