GithubHelp home page GithubHelp logo

flappy_bird_bevy's Introduction

Rust + Bevy 实现的 Flappy Bird 游戏

简介

一个使用 bevy 引擎复刻的 Flappy Bird 经典小游戏。

简单介绍一下包含的内容:

  • 游戏状态管理 Menu、InGame、Paused、GameOver。
  • 小鸟碰撞检测。
  • 地面移动。
  • 小鸟飞翔动画。
  • 小鸟飞行方向变化。
  • 小鸟重力系统。
  • 障碍物随机生成。

通过空格向上飞行。 按 P 暂停游戏,按 R 恢复游戏。

代码结构

·
├── assets/
│   ├──audios/
│   ├──fonts/
│   └──images/
├── src/
│   ├── components.rs
│   ├── constants.rs
│   ├── main.rs
│   ├── obstacle.rs
│   ├── player.rs
│   ├── resource.rs
│   └── state.rs
├── Cargo.lock
└── Cargo.toml
  • assets/audios 声音资源文件。
  • assets/fonts 字体资源文件。
  • assets/images 图片资源文件。
  • components.rs 游戏组件定义。
  • constants.rs 负责存储游戏中用到的常量。
  • main.rs 负责游戏的逻辑、插件交互、等内容。
  • obstacle.rs 障碍物生成、初始化。
  • player.rs 玩家角色插件,生成、移动、键盘处理的实现。
  • resource.rs 游戏资源定义。
  • state.rs 游戏状态管理。

about me

目前失业,在家学习 rust 。

我的 bilibili,我的 博客园

Rust官网 Rust 中文社区

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.