Skip to content

hammadmajid/trash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Oscar's Trash Bin

A retro-style game built with Raylib and compiled to WebAssembly for web deployment.

Features

  • Web-based gameplay (runs in browser via WebAssembly)
  • Simple keyboard controls
  • Scoreboard tracking
  • Retro aesthetic

Building

Prerequisites

  • Emscripten SDK (emcc compiler)
  • Node.js/pnpm (for serving)

Commands

# Build the game
make build

# Build and serve locally
make serve

The build process compiles the C source code to trash.html using Emscripten, creating a complete web-based game.

Controls

  • Arrow Keys: Navigate menu options
  • Enter: Select menu item
  • ESC: Exit (when window close is triggered)

Project Structure

  • src/ - C99 source code
    • main.c - Entry point and game loop
    • menu.h/c - Menu system implementation
    • game.h - Core game logic
  • raylib/ - Raylib framework and dependencies
  • Makefile - Build configuration

Technology Stack

  • Language: C99
  • Graphics: Raylib
  • Build: Emscripten (WebAssembly)
  • Deployment: Web browser

Development Guide

The game follows C99 standards.

  • Includes: Raylib relative path ../raylib/raylib.h, local headers with quotes
  • Formatting: 4-space indentation, K&R brace style
  • Error handling: Simple return codes, no exceptions (web target compatibility)
  • Memory: Stack allocation preferred, RAII patterns
  • Comments: Avoid unless documenting complex logic

About

Oscar's Trash Bin

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages