瀏覽代碼

gbe.nodes.Node given 'hidden' methods intended to be used by astate machine. This, in effect, makes a Node tree the core of a game state machine

master
Bryan Miller 6 年之前
父節點
當前提交
8435bfa423
共有 1 個檔案被更改,包括 17 行新增0 行删除
  1. +17
    -0
      game/gbe/nodes.py

+ 17
- 0
game/gbe/nodes.py 查看文件

@@ -187,6 +187,23 @@ class Node:
return c
return None

def _init(self):
if hasattr(self, "on_init"):
self.on_init()
for c in self._NODE_DATA["children"]:
c._init()

def _close(self):
if hasattr(self, "on_close"):
self.on_close()
for c in self._NODE_DATA["children"]:
c._close()

def _pause(self):
if hasattr(self, "on_pause"):
self.on_pause()
for c in self._NODE_DATA["children"]:
c._pause()

def _update(self, dt):
if hasattr(self, "on_update"):

Loading…
取消
儲存