Build Paddle
In this tutorial, you’ll build a complete Paddle game from scratch. By the end, you’ll have a fully playable game with:
- Two paddles (player-controlled or AI)
- Ball physics with collision detection
- Score tracking and win conditions
- Sound effects
- Title screen and game over states
- Automatic online multiplayer via Emberware’s rollback netcode

What You’ll Learn
| Part | Topics |
|---|---|
| Part 1: Setup & Drawing | Project creation, FFI imports, draw_rect() |
| Part 2: Paddle Movement | Input handling, game state |
| Part 3: Ball Physics | Velocity, collision detection |
| Part 4: AI Opponent | Simple AI for single-player |
| Part 5: Multiplayer | The magic of rollback netcode |
| Part 6: Scoring & Win States | Game logic, state machine |
| Part 7: Sound Effects | Procedural audio |
| Part 8: Polish & Publishing | Title screen, publishing to archive |
Prerequisites
Before starting this tutorial, you should have:
- Completed Your First Game
- Rust and WASM target installed (Prerequisites)
- Basic understanding of the game loop
Final Code
The complete source code for this tutorial is available in the examples:
emberware/examples/paddle/
├── Cargo.toml
├── ember.toml
└── src/
└── lib.rs
You can build and run it with:
cd examples/paddle
cargo build --target wasm32-unknown-unknown --release
ember run target/wasm32-unknown-unknown/release/paddle.wasm
Time Investment
Each part takes about 10-15 minutes to complete. The full tutorial can be finished in about 2 hours.
Ready? Let’s start with Part 1: Setup & Drawing.