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.

game.py 812B

12345678910111213141516171819202122232425262728293031323334353637
  1. import bge
  2. import FSM
  3. import requests
  4. import platform
  5. import os
  6. def phone_home():
  7. url = 'https://shuvit.org/phone_home.php'
  8. n = platform.uname()
  9. n = platform.platform()
  10. myobj = {'somekey': n}
  11. x = requests.post(url, data = myobj, timeout=3.50)
  12. print('phone home response')
  13. print(x.text)
  14. def get_map_list():
  15. out = []
  16. ldir = bge.logic.expandPath("//assets/maps")
  17. out = os.listdir(ldir)
  18. print('$$$$$$$$$$$$$$$$$$$$$$$out', out)
  19. return out
  20. def main(cont):
  21. own = cont.owner
  22. dict = bge.logic.globalDict
  23. if 'game_inited' not in own:
  24. info = bge.logic.PrintGLInfo()
  25. own['game_inited'] = True
  26. own['cont'] = cont
  27. dict['gameFSM'] = FSM.GameFSM(own)
  28. dict['game_life'] = 0
  29. dict['maps'] = get_map_list()
  30. #phone_home()
  31. if 'game_life' in dict:
  32. dict['game_life'] += 1
  33. dict['gameFSM'].Execute()