NightsWatchGames / battle-city

Classical battle-city game made with bevy engine.
https://nightswatchgames.github.io/games/battle-city/
MIT License
85 stars 11 forks source link
battle-city bevy game rust

English

battle-city 坦克大战游戏

在线游玩:点这里(电脑版Chrome/Firefox/Edge打开)

运行

  1. 本地运行
    cargo run
  2. WASM运行
    rustup target install wasm32-unknown-unknown
    cargo install wasm-server-runner
    cargo run --target wasm32-unknown-unknown
    cargo install wasm-bindgen-cli
    cargo build --release --target wasm32-unknown-unknown
    wasm-bindgen --out-dir ./out/ --target web ./target/wasm32-unknown-unknown/release/battle-city.wasm

游戏展示

视频演示:B站

start_menu game_playing game_over

参考资料

问题

1.2d游戏角色改变方向时,通常是切换sprite还是进行sprite旋转?

2.Sprite Sheet 和 Texture Atlas 理解和区别? Texture Atlas 是指一张大图片(图集)包含多个texture,Sprite Sheet 通常是指一张大图片包含帧动画的每一帧(texture),实质上跟 Texture Atlas 一样。在 Bevy 0.10 中,帧动画(SpriteSheetBundle)也是直接使用 struct TextureAtlas 存储图集,并没有使用单独的 struct SpriteSheet 存储。