Skip to content

Latest commit

 

History

50 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tag 2.5

A local multiplayer tag game with physics, built in Odin with Raylib and Clay.

One player is it, marked with an arrow on their head, and if any other player contacts them, they become the tagged player. as of right now, only one player can be tagged at a time. Once the timer ends, the player who is it will lose.

p1 is controlled by A and D keys and p2 is left and right arrows.

Building

Requires the Odin compiler with vendor libraries installed.

just build    # build only
just          # build and run
just gdb      # build and run under gdb

Or manually:

mkdir -p build
odin build src -debug -out:build/main
./build/main

Making Maps

Maps are defined by a directory under assets/arenas/<name>/ containing:

  • <name>.txt: arena config, see format below
  • pretty.json: a Tiled .tmx exported as JSON, must use the "Embed in Map" option when adding the tileset to Tiled, otherwise the parser will fail
  • *.png: tileset image, parallax background layers, and a thumbnail

Arena config format

name: grass
layer: bg3.png 0.6
layer: bg2.png 1
layer: bg.png 1.2
tilemap: pretty.json
player: 300 400
player: 400 350
thumb: maynard.png
Key Purpose
name Display name shown on the map select screen
layer A parallax background image and its scroll factor (lower = slower, i.e. farther away)
tilemap Path to the Tiled JSON export
player Spawn position as x y (pixel coordinates); one player line per player
thumb Thumbnail image shown in the map select screen

Tileset collision

Add a custom property (any name, type list of floats) to each tile in your Tiled tileset. The floats define a polyline as (x0, y0, x1, y1, ...) in normalized tile coordinates where (0,0) is top-left and (1,1) is bottom-right. Segments are drawn between consecutive points to form collision geometry.

Recommended tile size is 16×16, matching PLAYER_RAD.

Tech

  • Odin — the language and build system
  • Raylib — windowing, rendering, input, texture loading
  • Clay — retained-mode UI (menus, HUD, map select) with a Raylib renderer
  • Tiled — map editor; the JSON parser reads embedded tilesets and per-tile collision data directly

Thanks to Nic Barker for Clay, it made the UI layer a pleasure to build

License

Public domain (Unlicense).

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages