Shuvit game master repo. http://shuvit.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

player.py 473B

1234567891011121314151617181920212223
  1. import bge
  2. import FSM
  3. class Player:
  4. def __init__(self, own):
  5. self.owner = own
  6. self.FSM = FSM.PlayerFSM(own)
  7. self.walking = True
  8. def update(self):
  9. self.FSM.Execute()
  10. def update(cont):
  11. #print('-------------player updating----------------')
  12. dict = bge.logic.globalDict
  13. own = cont.owner
  14. if 'player_class' not in dict:
  15. #dict['playerFSM'] = FSM.PlayerFSM(own)
  16. dict['player_class'] = Player(own)
  17. #dict['playerFSM'].Execute()
  18. dict['player_class'].update()