volodalexey / simple-bevy-wasm-ball-game

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple Bevy and WASM (WebAssembly) Ball Game

Originally created by frederickjjoubert as Ball Game in following video playlist Learn Bevy Engine 0.10 Beginner Tutorial Series.

Refactored to use WASM with touch/mouse support

Full YouTube playlist:

Learn Bevy 0.10 - EP1 - Intro Tutorial to Bevy Game Engine Entity Component System and Queries

Learn Bevy 0.10 - EP2 - First Game Setup + Bundles and Resources - Bevy Tutorial

Learn Bevy 0.10 - EP3 - Player Movement from Keyboard Input and Spawning Enemies - Bevy Tutorial

Learn Bevy 0.10 - EP4 - Enemy Movement, Collisions, Sound Effects, Despawning - Bevy Tutorial

Learn Bevy 0.10 - EP5 - Spawning and Collecting Stars, Score Resource, and Timers - Tutorial

Learn Bevy 0.10 - EP6 - Spawning Enemies over Time, and Bevy Events! - Bevy Engine Beginner Tutorial

Learn Bevy 0.10 - EP7 - Bevy Project Organization and Refactor, Rust Modules, and Bevy Plugins

Learn Bevy 0.10 - EP8 - Explicit System Ordering and Bevy System Sets

Learn Bevy 0.10 - EP9 - Bevy States and Run Conditions

Learn Bevy 0.10 - EP10 - Bevy UI (User Interface Tutorial)

Compile to WASM (WebAssembly) and build for browser

Add WebAssembly support to your Rust installation

rustup target install wasm32-unknown-unknown

Install wasm-bindgen CLI

cargo install wasm-bindgen-cli

Run build script

./wasm/build.sh

WASM build history

Initial

  • 24603385 simple-bevy-wasm-ball-game_bg.wasm
  • 88108 simple-bevy-wasm-ball-game.js

Replaced rand with fastrand

  • 24585077 simple-bevy-wasm-ball-game_bg.wasm
  • 88108 simple-bevy-wasm-ball-game.js

Use 3d assets from glb file and animations

  • 24725317 simple-bevy-wasm-ball-game_bg.wasm
  • 88108 simple-bevy-wasm-ball-game.js

Use Instant from bevy

  • 24682460 simple-bevy-wasm-ball-game_bg.wasm
  • 88108 simple-bevy-wasm-ball-game.js

Use Rapier physics engine

  • 26932957 simple-bevy-wasm-ball-game_bg.wasm
  • 88108 simple-bevy-wasm-ball-game.js

Use optimizations for modules

  • 26990021 simple-bevy-wasm-ball-game_bg.wasm
  • 88108 simple-bevy-wasm-ball-game.js

Use optimizations (codegen-units = 1, opt-level = 'z', lto = true)

  • 13672132 simple-bevy-wasm-ball-game_bg.wasm
  • 87175 simple-bevy-wasm-ball-game.js

Migrated to bevy 0.11 and use bevy_ui_styled

  • 15840612 simple-bevy-wasm-ball-game_bg.wasm
  • 87420 simple-bevy-wasm-ball-game.js

About


Languages

Language:Rust 91.1%Language:JavaScript 5.6%Language:HTML 1.4%Language:CSS 1.3%Language:Shell 0.7%