定制 chemaclass/phel-flappybird 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

chemaclass/phel-flappybird

Composer 安装命令:

composer create-project chemaclass/phel-flappybird

包简介

Flappy Bird in your terminal — a CLI game written in Phel (Lisp on PHP).

README 文档

README

A CLI Flappy Bird written in Phel (a Lisp that compiles to PHP). Flap through scrolling pipes in your terminal.

+----------------------------------------------------------+
|                                          ###             |
|                                          ###             |
|                                                          |
|        @                                                 |
|                                          ###             |
|                                          ###             |
+----------------------------------------------------------+
Score: 3     High: 7     (space/up = flap, q = quit)

Play

From a release PHAR (needs only PHP 8.4+):

# download phel-flappybird.phar from the Releases page, then:
php phel-flappybird.phar

From source:

composer install
composer dev          # run straight from source
# or compile an entry point and run it:
composer start        # = composer build && composer play

Controls

Key Action
space / flap
q quit
r replay (game over)

Options

Pass key=value arguments to tune the game:

php phel-flappybird.phar width=80 height=30 gap=8 gravity=0.25
Option Default Meaning
width=N 60 board width
height=N 22 board height
gap=N 6 pipe gap height
spacing=N 22 columns between pipes
gravity=F 0.20 downward acceleration / tick
flap=F -0.95 velocity applied on a flap
delay=N 90000 tick delay in microseconds
debug off physics overlay

--version and --help print info and exit.

Your best score is saved to ~/.phel-flappybird-highscore.

Architecture

Functional core / imperative shell:

  • src/core/physics.phelpure. The whole game is one immutable world map ({:bird :pipes :score :dead?}) advanced by a single step reducer. Randomness is injected by the caller, so step is deterministic and fully unit-tested.
  • src/core/render.phel, src/core/input.phel — the effectful edges (terminal drawing via phel-cli-gui, keyboard reading).
  • src/game.phel — the loop: read input → step → render → sleep → repeat.

Development

composer test           # run the phel test suite
composer format         # format src + tests
composer build          # compile to out/
composer phar           # build build/out/phel-flappybird.phar
composer ci             # format-check + test + build

Releasing

./tools/release.sh 0.1.0          # validate, build+smoke-test PHAR, tag, GH release
./tools/release.sh --dry-run      # preview without changing anything

License

MIT

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: Shell

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固