mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-25 04:32:33 -06:00
36 lines
994 B
Python
36 lines
994 B
Python
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
|
from direct.fsm import ClassicFSM, State
|
|
|
|
class DistributedPillowAI(DistributedObjectAI):
|
|
|
|
def __init__(self, air):
|
|
DistributedObjectAI.__init__(self, air)
|
|
self.fsm = ClassicFSM.ClassicFSM(
|
|
'DistributedPillowAI',
|
|
[
|
|
State.State('off', self.enterOff, self.exitOff,
|
|
['bounce']),
|
|
State.State('bounce', self.enterBounce, self.exitBounce,
|
|
['off']),
|
|
], 'off', 'off')
|
|
self.fsm.enterInitialState()
|
|
|
|
def generate(self):
|
|
DistributedObjectAI.generate(self)
|
|
|
|
def delete(self):
|
|
self.fsm.requestFinalState()
|
|
del self.fsm
|
|
DistributedObjectAI.delete(self)
|
|
|
|
def enterOff(self):
|
|
pass
|
|
|
|
def exitOff(self):
|
|
pass
|
|
|
|
def enterBounce(self):
|
|
pass
|
|
|
|
def exitBounce(self):
|
|
pass
|