Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lostjared/breakout.rust.web
Web Assembly Rust program for a 2D Breakout Clone Demo
https://github.com/lostjared/breakout.rust.web
2d-game rust rustwasm webassembly webassembly-demo
Last synced: 5 days ago
JSON representation
Web Assembly Rust program for a 2D Breakout Clone Demo
- Host: GitHub
- URL: https://github.com/lostjared/breakout.rust.web
- Owner: lostjared
- License: mit
- Created: 2024-05-20T07:07:49.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-05-20T12:46:12.000Z (6 months ago)
- Last Synced: 2024-05-21T08:29:42.097Z (6 months ago)
- Topics: 2d-game, rust, rustwasm, webassembly, webassembly-demo
- Language: JavaScript
- Homepage: https://lostsidedead.biz/breakout
- Size: 146 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Breakout Clone in Rust / WebAssembly
![Example Image](https://github.com/lostjared/Breakout.Rust.Web/blob/main/screens/breakout.rust.jpg)
# Breakout Game with WebAssembly
This project is a Breakout game implemented using JavaScript and WebAssembly. It supports both mouse and touch events for paddle movement.
## Requirements
- Rust
- wasm-pack
- JavaScript
- HTML## Building the Project
To build the WebAssembly module, run the following command:
```sh
wasm-pack build --target web --out-dir web
```## Running the Game
Run a Python 3 local webserver
```sh
python3 -m http.server 3000
```1. Open the `index.html` file in your web browser to run the game.
2. Use the mouse or touch input to move the paddle and play the game.## Project Structure
- `src/`: Contains the Rust source code for the WebAssembly module.
- `web/`: Contains the compiled WebAssembly module and other web assets (HTML, JavaScript, CSS).## Handling Mouse and Touch Events
The project includes functions to handle both mouse and touch events for paddle movement:
## License
This project is licensed under the MIT License.