aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorpack <pack@packgekko.xyz>2026-08-07 18:54:43 +0000
committerpack <pack@packgekko.xyz>2026-08-07 18:54:43 +0000
commit8030f96ad2c964040349955627e14c844fc8986d (patch)
tree7e6d66868f2b9c2de455c9760b6fbc7339480ecd /README.md
parentd10aa45825dcd9c7ed08dd66356a8c0f86870806 (diff)
downloadtiny-8030f96ad2c964040349955627e14c844fc8986d.tar.gz
final commit 2king
add LICENSE, edit README.md
Diffstat (limited to 'README.md')
-rw-r--r--README.md65
1 files changed, 65 insertions, 0 deletions
diff --git a/README.md b/README.md
index e69de29..ef46feb 100644
--- a/README.md
+++ b/README.md
@@ -0,0 +1,65 @@
+# prj tiny
+
+A small first-person sword combat game built with [raylib](https://www.raylib.com/). Fight a single enemy in a starlit arena. Built as a learning/prototype project.
+
+![screenshot](screenshot.png)
+
+## ~features
+
+- **First-person melee combat** — left-click to swing your sword
+- **Procedural audio** — sword swings, footsteps, and ambient drone are all generated in code (no audio files needed)
+- **Enemy AI** — the enemy auto-attacks on a randomized timer and turns to face you
+- **Player death & respawn** — die and you respawn after 2 seconds
+- **Title screen + pause menu** — mouse-driven UI with fade transitions
+- **Twinkling starfield** — 200 stars with per-star phase animation
+- **Streaming background music** — drop in your own `music.ogg`
+
+## ~controls
+
+| Action | Input |
+|--------|-------|
+| Move | WASD |
+| Look | Mouse |
+| Swing sword | Left click |
+| Pause | ESC |
+| Start game | Click PLAY or ENTER |
+
+## ~requirements
+
+- [raylib](https://github.com/raysan5/raylib) (built with audio + OGG/Vorbis support)
+- A C compiler (gcc/clang)
+- `music.ogg` (optional — place next to the binary)
+
+## ~build
+
+```bash
+gcc tiny.c -o tiny -lraylib -lm -lGL -lpthread -ldl -lrt -lvorbisfile -lvorbis -logg
+```
+
+For a static build (recommended for distribution):
+
+```bash
+gcc tiny.c -o tiny -Wl,-Bstatic -lraylib -lvorbisfile -lvorbis -logg \
+ -Wl,-Bdynamic -lGL -lm -lpthread -ldl -lrt
+```
+
+## ~run
+
+```bash
+./tiny
+```
+
+> `music.ogg` is loaded relative to your working directory. Place it next to the binary if you want background music. The game runs fine without it.
+
+## ~how it works
+
+The game is a single C file (~625 lines) with no external assets except an optional music file:
+
+- **Graphics:** raylib's 3D immediate-mode API (`DrawCube`, `DrawCylinderEx`, etc.) for the world + sword models, 2D overlay for HUD/menus
+- **Audio:** sounds are synthesized at runtime into `Wave` structs and loaded via `LoadSoundFromWave` — no `.wav` files needed
+- **Combat:** sword swings are time-based with damage applied at the swing midpoint, gated by a `damage_dealt` flag to prevent multi-hit
+- **Camera:** raylib's built-in `CAMERA_FIRST_PERSON` mode
+
+## ~license
+
+Trinity License