- 🔭 I'm rewriting hedgehog
- 🌱 I’m currently learning LLVM.
- 📫 How to reach me: yangtau.me
feed-the-dragon's Introduction
feed-the-dragon's People
feed-the-dragon's Issues
UI 设计实现
任务
- 设计可复用的 UI 组件:各种按键,列表等等。
- Page 接口(基类)设计,所有其他 Page 都从它派生。
- PageManager 设计,管理各个 Page,处理 Page 打开关闭的逻辑。
- 开始界面,设置界面,关卡选择界面实现。
Note
UI 方面应该有很多成熟的可用的开源项目,参考 GUI。Page 类,PageManager 类的设计应该也有,需要找一找(名字可能不同,不一定叫 Page)。尽量使用现成的组件,简化开发。
这方面的开发不需要考虑当前已有的代码,目前的 Game 类只相当于一个测试,之后应该是一个 Page。在完成 Page 和 PageManager 的设计之后,再重写 GamePage 。
背景相关图标,图片资源可以看看 res-backup 文件夹中有没有适合的。opengameart 中有很多开放的资源也可以参考。
根据 page_manager 接口更新 map editor
Task
- 从 page_manager.PageBase 派生出 MapEditorPage
- 完善界面:地图名输入框,确认按钮等
- 地址信息更新到 resources/config/level.json 中
Note
首先把 ui 分支合并到 map_editor 分支:git merge origin/ui
派生子类的实现可以参考start_page,game_page。
Button,TextInput 等控件可以考虑使用 pygame_gui.elements 中的组件。我已经完成了对 pygame_gui 的事件处理的一些封装,可以通过 PageBase 类的 regesiter_gui_event_handler 完成事件注册,使用方法可以参考 start_page 中的按钮使用方法。参考文档:pygame_gui docs, Input 事件。
level.json 文件更新可以考虑在 resources/resource.py 中增加方法,避免直接读写文件。
地图编辑器
任务
- 地图编辑器
Note
应该可以在已有的基础上写,参考 surfaces.Map 类的实现。尽量复用 surfaces.Map 的代码。
鼠标拖拽的逻辑可以参考 Game 类中的 drag_handler 的实现。
资源文件的格式为 json,保存在 resources/config/ 目录下。具体的格式参考已有的资源文件 map-1.json, toolbox-1.json。格式没有完全确定下来,可能更改。
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.