o
odinpkg.dev
packages / app / dino-game

dino-game

4cdded5app

Recreation of the offline Google Chrome dinosaur game

MIT · updated 4 months ago

Game logo.

dino-game

Recreation of the offline Google Chrome dinosaur game. Made with Odin & Raylib.

Build

Building the game is as simple as invoking the Odin compiler on the source directory: odin build source. The provided build scripts act as wrappers for common sets of flags, and on Windows invoke the Resource compiler to link the executable with an icon.

build.bat          Build with debug info, no optimizations and console output enabled; Link icon through the Resource compiler
build_release.bat  Build with debug info, optimizations and console output disabled; Link icon through the Resource compiler

build.sh           Build with debug info, no optimizations

Reference

The implementation uses trex-runner as a reference, mostly for constants and physics, so that the feel is as close to the original as possible. The code structure, however, is completely different.

Style

The entire game logic is written inside the main function, and is laid out as linearly as possible. Long functions are preferred over short ones. Naming things is avoided unless necessary.