8000 GitHub - nharan/monopoly_wasm: Monopoly game done in rust and WASM
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

nharan/monopoly_wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Monopoly WASM

A Monopoly game implemented in Rust with WebAssembly (WASM) and egui.

Overview

This project is a web-based implementation of the classic Monopoly board game, built using Rust and compiled to WebAssembly. The game features:

  • A complete 40-space Monopoly board with properties, railroads, utilities, and more
  • Support for 1 human player and 1-3 AI opponents with different difficulty levels
  • Standard Monopoly rules with some interesting modifications
  • A clean, text-and-color based UI that runs in any modern browser

Game Rules

The game follows standard Monopoly rules with these modifications:

  1. Property Acquisition: When landing on an unowned property, players can choose to buy it or auction it.
  2. GO Salary: The GO salary starts at $200, decreases by $10 each time any player passes GO until it reaches $0, then increases by $10 until it reaches $500.

AI Difficulty Levels

  • Passive: Conservative strategy, maintains high cash reserves, bids up to 50% of property value
  • Normal: Balanced strategy, maintains moderate cash reserves, bids up to 100% of property value
  • Aggressive: Risk-taking strategy, maintains low cash reserves, bids up to 150% of property value

Building and Running

Prerequisites

Build Steps

  1. Clone the repository:

    git clone https://github.com/yourusername/monopoly_wasm.git
    cd monopoly_wasm
    
  2. Build the WebAssembly package:

    wasm-pack build --target web
    
  3. Serve the static directory:

    # Using Python's built-in HTTP server
    python -m http.server -d static
    
  4. Open your browser and navigate to http://localhost:8000

Project Structure

The project follows an MVC (Model-View-Controller) architecture:

  • Model: Game data and business logic
  • View: UI rendering using egui
  • Controller: Game flow and user input handling

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • The egui team for their excellent immediate mode GUI library
  • The Rust and WebAssembly communities for their tools and documentation

About

Monopoly game done in rust and WASM

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0