Skip to content

willnjl/Snake-Game-Rust-Wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake Game in Rust with WASM and TypeScript 🦀

The game is a basic rendition of the classic game Snake. This project was a just for fun example to get familiar with the Rust programming language. This implementation combines the power of Rust compiled to WebAssembly (WASM) and executed with TypeScript

It is based of the the Rust Udemy Course from Jerga99

Try the Game

You can try it out in your browser here.

Technologies Used

  • Rust: The game logic and functionality are implemented in Rust, a powerful and performant systems programming language.

  • Cargo: Rust's package manager and build system, used to manage dependencies and build the project.

  • WASM_Bindgen: This tool facilitates communication between Rust and JavaScript, allowing the Rust code to be compiled to WebAssembly and integrated with the TypeScript code.

  • TypeScript: The game is orchestrated and enhanced using TypeScript, a superset of JavaScript that adds static typing and other features.

  • Tailwind CSS: A utility-first CSS framework used for styling the user interface, providing a clean and responsive design.

Running the Project Locally

To run the project locally, follow these steps:

  1. Clone the Repository:

    git clone https://github.com/willnjl/Snake-Game-Rust-Wasm.git
  2. Navigate to the Project Directory:

    cd Snake-Game-Rust-Wasm
  3. Compile Rust:

    wasm-pack build --target web
  4. Generate the Frontend

    cd www/ && npm run dev

    This will build the Rust code to WebAssembly, compile the TypeScript code, and serve the project locally.

  5. Open in Browser:

    Open your web browser and go to http://localhost:8080 to play the Snake Game.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors