packages/library/topdownshooter
t

topdownshooter

d85197flibrary

No description provided.

0 stars0 forksUnknownupdated 4 months ago
Open repo

Odin Raylib Network Shooter

A small top-down shooter written in Odin using the bundled vendor:raylib package and the local sprite/audio folders in this workspace.

Controls

  • WASD move
  • Mouse aim
  • Hold left mouse button to shoot
  • 1 / 2 / 3 / 4 use the ability in that slot
  • Space jump if you have stamina
  • Shift dash if you have stamina
  • E pick up / swap weapon or ability
  • G drop a grenade and auto-dash away from it
  • Enter starts the round when you are the host and the lobby is waiting
  • F8 open the network simulation panel

Multiplayer

This is now real host/client multiplayer for local testing and LAN play, using the bundled vendor:ENet package.

  • Build the Windows executable with .\build.ps1
  • Launch one window as host: .\topdownshooter.exe -host
  • Optional: host on a custom bind address/port: .\topdownshooter.exe -host 0.0.0.0:24567
  • Join from the same machine: .\topdownshooter.exe -join 127.0.0.1:24567
  • Join from another device on the same network: .\topdownshooter.exe -join <host-lan-ip>:24567
  • If you run without args, the game opens a small launcher overlay:
    • H hosts on 0.0.0.0:24567 so LAN clients can connect
    • J joins the host entered in the UI field
    • The join field defaults to 192.168.31.9 and can be edited in-game before connecting

The host simulates the match authoritatively. Each client sends input and renders replicated state from the host. Matches are now fixed to 3 vs 3 with up to 6 total players. When hosting, the game starts in a lobby. The host can wait for other humans to join, then press Enter to start the round. Any empty slots are filled with bots when the round begins.

Assets Used

  • Player sprites from SATYR_sprite_sheet/SPRITE_SHEET.png
  • Separate weapon, bullet, muzzle, and crosshair sprites from the same pack
  • Fire projectile sprites cropped from New_All_Fire_Bullet_Pixel_16x16
  • Procedurally generated shoot SFX at runtime

Current Features

  • Up to 6-player LAN multiplayer in 3 vs 3 team matches
  • Host lobby flow with manual round start
  • Host-side bots that fill empty team slots when the round starts
  • Host-authoritative bullets, grenades, pickups, abilities, stamina, damage, and score
  • Built-in network simulation panel for latency, jitter, packet loss, and duplication testing
  • Camera follows the local player in each window
  • Simple environment with cover blocks, collision, weapon spawn pads, and ability spawn pads
  • Separate body damage hitbox for players
  • Pistol, rifle, shotgun, and claws weapon behavior with weapon swapping and timed ground despawns
  • Fireball, electricity, water, angry bull, and dig abilities with pickups, four local ability slots, puddles, status effects, and replicated visuals
  • Team elimination win condition with death animation and round-end state
  • Jump dodge, longer dash, bull charge trails, movement dust, blood hit splatter, bleed VFX, stronger ignite VFX, grenade blast knockback, hit-confirm feedback, labeled ability pickups, and sprite-based weapons/projectiles/muzzle flashes

Code Layout

  • main.odin: entrypoint, launch mode parsing, and top-level frame loop
  • types.odin: shared constants, game state, and network packet types
  • math_utils.odin: vector and scalar helpers
  • assets.odin: texture, animation, and sound loading
  • combat.odin: weapons, hitboxes, abilities, status effects, grenades, stamina usage, elimination, and pickup lifecycle
  • environment.odin: map setup, collision, and arena drawing
  • gameplay.odin: local input capture, authoritative simulation, and camera logic
  • networking.odin: ENet host/client replication and snapshot packing
  • rendering.odin: entity, HUD, and connection/menu overlays
  • animation.odin: animation helpers and shared sprite drawing

Build

.\build.ps1

This Windows build script compiles with RAYLIB_SHARED=true and copies raylib.dll beside topdownshooter.exe so the game starts correctly with the existing repo-relative asset paths.

VS Code

  • Ctrl+Shift+B runs the default Build topdownshooter task.
  • F5 runs the selected launch config from .vscode/launch.json.
  • Pick Launch in the VS Code run dropdown to start both host and client together.
  • Available launch configs: Launch, Launcher, Host, and Client.
  • If VS Code asks for recommended extensions, install Odin and C/C++.
Package Info
Version
d85197f
License
Unknown
Author
@MagicianK
Type
library
Forks
0
Created
4 months ago
Updated
4 months ago
Health
maintained
has releases
has readme
has license
Activity
last 56 weeks