1 Star 0 Fork 0

Junruoyu-Zheng/programming-battle

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
app.py 668 Bytes
一键复制 编辑 原始数据 按行查看 历史
import numpy as np
from world import World
from entities.soldier_entity import SoldierEntity
from systems.update_position_system import UpdatePositionSystem
class Application:
def run(self):
soldier:SoldierEntity = SoldierEntity()
World.entities.append(soldier)
World.components.extend(soldier.components)
World.systems.append(UpdatePositionSystem())
for t in np.arange(0, 10, 0.01):
for system in World.systems:
system.tick(0.01)
# hack code:
print(f'soldier is at pos: {soldier.components[0].x}, {soldier.components[0].y}')
app = Application()
app.run()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/junruoyu-zheng/programming-battle.git
git@gitee.com:junruoyu-zheng/programming-battle.git
junruoyu-zheng
programming-battle
programming-battle
master

搜索帮助