|
@@ -18,7 +18,7 @@ from synergine2.terminals import Terminal
|
18
|
18
|
from synergine2.terminals import TerminalPackage
|
19
|
19
|
from synergine2_cocos2d.actions import MoveTo
|
20
|
20
|
from synergine2_cocos2d.actor import Actor
|
21
|
|
-from synergine2_cocos2d.animation import Animate
|
|
21
|
+from synergine2_cocos2d.animation import Animate, ANIMATION_CRAWL
|
22
|
22
|
from synergine2_cocos2d.animation import ANIMATION_WALK
|
23
|
23
|
from synergine2_cocos2d.exception import InteractionNotFound
|
24
|
24
|
from synergine2_cocos2d.exception import OuterWorldPosition
|
|
@@ -400,6 +400,8 @@ class EditLayer(cocos.layer.Layer):
|
400
|
400
|
self.user_action_pending = UserAction.ORDER_MOVE
|
401
|
401
|
if k == key.R:
|
402
|
402
|
self.user_action_pending = UserAction.ORDER_MOVE_FAST
|
|
403
|
+ if k == key.C:
|
|
404
|
+ self.user_action_pending = UserAction.ORDER_MOVE_CRAWL
|
403
|
405
|
|
404
|
406
|
if k in binds:
|
405
|
407
|
self.buttons[binds[k]] = 1
|
|
@@ -761,6 +763,7 @@ class TMXGui(Gui):
|
761
|
763
|
# configs
|
762
|
764
|
self.move_duration_ref = float(self.config.resolve('game.move.walk_ref_time'))
|
763
|
765
|
self.move_fast_duration_ref = float(self.config.resolve('game.move.run_ref_time'))
|
|
766
|
+ self.move_crawl_duration_ref = float(self.config.resolve('game.move.crawl_ref_time'))
|
764
|
767
|
|
765
|
768
|
def get_layer_middleware(self) -> MapMiddleware:
|
766
|
769
|
return TMXMiddleware(
|
|
@@ -801,6 +804,10 @@ class TMXGui(Gui):
|
801
|
804
|
animation = ANIMATION_WALK
|
802
|
805
|
cycle_duration = 0.5
|
803
|
806
|
move_duration = self.move_fast_duration_ref
|
|
807
|
+ elif event.gui_action == UserAction.ORDER_MOVE_CRAWL:
|
|
808
|
+ animation = ANIMATION_CRAWL
|
|
809
|
+ cycle_duration = 2
|
|
810
|
+ move_duration = self.move_crawl_duration_ref
|
804
|
811
|
else:
|
805
|
812
|
raise NotImplementedError()
|
806
|
813
|
|