文章摘要
这是一个用Emacs Lisp编写的简易版SimCity模拟游戏项目,托管在GitHub上,名为elcity。
文章总结
GitHub项目:ElCity - 基于Emacs Lisp的简易SimCity克隆游戏
项目地址:https://github.com/vkazanov/elcity
项目概述
ElCity是一个运行在Emacs中的回合制城市建设模拟游戏,使用Emacs Lisp编写。该项目采用"功能核心/命令式外壳"架构,核心模拟逻辑是确定性的,用户界面负责渲染和输入处理。
主要特点: - 纯ASCII界面,适配终端环境 - 基于DSL的瓦片类型定义系统 - 状态与效果的严格分离 - 41个星标(截至文档时间)
技术规格
- 要求:Emacs 30.1+版本
- 可选:Eask依赖管理工具
- 文件结构:
- elcity.el(主入口文件)
- elcity-core.el(核心模拟逻辑)
- elcity-ui.el(用户界面)
- elcity-tiles.el(瓦片定义)
- test/(测试目录)
游戏机制
- 回合制推进(按n键)
- 资金增长公式:(人口/2)+(商业等级+工业等级)
- 市政厅作为道路连接中心点
- 发电厂提供6格曼哈顿半径的电力
- 区域等级系统(最高3级)
- 住宅区、商业区和工业区的相互依赖关系
控制方式
- R/C/I:选择住宅/商业/工业区域
- r/p/h:选择道路/电厂/市政厅
- 空格/回车:放置选定项目
- d:拆除
- u:撤销
- o:切换覆盖层显示
开发信息
- 测试:
make test运行ERT测试 - 代码检查:
make lint执行包检查、文档校验和字节编译 - 项目采用模块化设计,核心逻辑与UI分离
(注:已过滤GitHub页面导航菜单、用户登录选项等与项目核心内容无关的界面元素)
评论总结
这篇评论主要围绕一个基于Emacs的ASCII游戏展开讨论,包含以下观点:
- 对Emacs平台游戏的积极评价:
- "This is great! We need more ASCII games/simulations and it's only a bonus if it's in Emacs"(michaelanckaert)
- "Fantastic!...Finally RMS can play SimCity"(DonHopkins)
- 建议改进游戏设计:
- 建议解耦Emacs核心:"Consider decoupling the core from Emacs"(brimtown)
- 建议增加地震特效:"Can you make Emacs shake the screen...whenever there's an earthquake?"(DonHopkins)
- 其他相关讨论:
- 分享类似项目:"I've been doing my own exploration of terminal ASCII games via Dwarf Fortress"(brimtown)
- 提到Emacs游戏库:"emacs has a color tile library for games, it's used in tetris"(mghackerlady)
- 游戏被收录至HN Arcade:"I have added this to the HN Arcade"(yuppiepuppie)
- 简单赞赏:
- "This is wonderful"(brimtown)
- "Amazing!"(yuppiepuppie)
- "Congrats on your Seventh Sally!"(morkalork)