Bastien Sevajol před 6 roky
rodič
revize
678896401f
1 změnil soubory, kde provedl 7 přidání a 0 odebrání
  1. 7 0
      opencombat/gui/base.py

+ 7 - 0
opencombat/gui/base.py Zobrazit soubor

@@ -350,6 +350,12 @@ class Game(TMXGui):
350 350
         firing_event = GuiFiringEvent(shooter_actor, event.weapon_type)
351 351
         original_actor_image = shooter_actor.image
352 352
 
353
+        def actor_rotate():
354
+            shooter_actor.rotation = get_angle(
355
+                shooter_actor.position,
356
+                event.target_position,
357
+            )
358
+
353 359
         def actor_firing():
354 360
             shooter_actor.firing(firing_event)
355 361
 
@@ -376,6 +382,7 @@ class Game(TMXGui):
376 382
             duration=0.2,  # TODO BS 2018-01-25: Wil depend of weapon type
377 383
             delay=delay,
378 384
             end_callback=actor_end_firing,
385
+            start_callback=actor_rotate,
379 386
         )
380 387
 
381 388
     def subject_die(self, event: DieEvent) -> None: