Explorar el Código

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 hace 6 años
padre
commit
8435bfa423
Se han modificado 1 ficheros con 17 adiciones y 0 borrados
  1. +17
    -0
      game/gbe/nodes.py

+ 17
- 0
game/gbe/nodes.py Ver fichero

@@ -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"):

Cargando…
Cancelar
Guardar