actor.py 982B

1234567891011121314151617181920212223242526272829303132333435
  1. # coding: utf-8
  2. import pyglet
  3. from sandbox.tile.gui.animation import ANIMATION_WALK
  4. from sandbox.tile.gui.animation import ANIMATION_CRAWL
  5. from synergine2.simulation import Subject
  6. from synergine2_cocos2d.actor import Actor
  7. class Man(Actor):
  8. animation_image_paths = {
  9. ANIMATION_WALK: [
  10. 'actors/man.png',
  11. 'actors/man_w1.png',
  12. 'actors/man_w2.png',
  13. 'actors/man_w3.png',
  14. 'actors/man_w4.png',
  15. 'actors/man_w5.png',
  16. 'actors/man_w6.png',
  17. 'actors/man_w7.png',
  18. 'actors/man_w8.png',
  19. 'actors/man_w9.png',
  20. 'actors/man_w10.png',
  21. ],
  22. ANIMATION_CRAWL: [
  23. 'actors/man_c1.png',
  24. 'actors/man_c2.png',
  25. 'actors/man_c3.png',
  26. 'actors/man_c4.png',
  27. ]
  28. }
  29. def __init__(self, subject: Subject) -> None:
  30. super().__init__(pyglet.resource.image('actors/man.png'), subject=subject)