base.py 903B

123456789101112131415161718192021222324252627282930
  1. # coding: utf-8
  2. import random
  3. from sandbox.tile.gui.animation import ANIMATION_WALK
  4. from sandbox.tile.gui.animation import ANIMATION_CRAWL
  5. from synergine2_cocos2d.animation import Animate
  6. from synergine2_cocos2d.gui import TMXGui
  7. class Game(TMXGui):
  8. def before_run(self) -> None:
  9. pass
  10. # Test
  11. # from sandbox.tile.gui.actor import Man
  12. # from cocos import euclid
  13. #
  14. # for i in range(10):
  15. # x = random.randint(0, 600)
  16. # y = random.randint(0, 300)
  17. # man = Man()
  18. # man.update_position(euclid.Vector2(x, y))
  19. # self.layer_manager.add_subject(man)
  20. # self.layer_manager.set_selectable(man)
  21. # man.scale = 1
  22. #
  23. # if x % 2:
  24. # man.do(Animate(ANIMATION_WALK, 10, 4))
  25. # else:
  26. # man.do(Animate(ANIMATION_CRAWL, 20, 4))