|
26 | 26 |
|
27 | 27 | # Mode descriptions shown in the HUD. |
28 | 28 | MODE_DESCRIPTIONS = { |
29 | | - 1: "Instant angle", |
| 29 | + 1: "Instant (teleport + face mouse)", |
30 | 30 | 2: "Angle ease: LINEAR", |
31 | 31 | 3: "Angle ease: QUAD_IN", |
32 | 32 | 4: "Angle ease: QUAD_OUT", |
@@ -126,10 +126,14 @@ def on_draw(self): |
126 | 126 | ) |
127 | 127 |
|
128 | 128 | def _target_angle(self) -> float: |
129 | | - """Compute the angle from the ship to the target in degrees.""" |
| 129 | + """Compute the angle from the ship to the target in degrees. |
| 130 | +
|
| 131 | + Arcade uses clockwise-positive angles and the ship sprite |
| 132 | + points up at angle 0, so we negate atan2 and add 90. |
| 133 | + """ |
130 | 134 | diff_x = self.target_x - self.ship_sprite.center_x |
131 | 135 | diff_y = self.target_y - self.ship_sprite.center_y |
132 | | - return math.degrees(math.atan2(diff_y, diff_x)) - 90 |
| 136 | + return -math.degrees(math.atan2(diff_y, diff_x)) + 90 |
133 | 137 |
|
134 | 138 | def _start_angle_ease(self): |
135 | 139 | """Record the current angle as the start and set up the ease.""" |
@@ -193,7 +197,10 @@ def on_mouse_press(self, x: int, y: int, button: int, modifiers: int): |
193 | 197 | self.target_x = x |
194 | 198 | self.target_y = y |
195 | 199 |
|
196 | | - if 2 <= self.mode <= 5: |
| 200 | + if self.mode == 1: |
| 201 | + self.ship_sprite.center_x = x |
| 202 | + self.ship_sprite.center_y = y |
| 203 | + elif 2 <= self.mode <= 5: |
197 | 204 | self._start_angle_ease() |
198 | 205 | elif 6 <= self.mode <= 9: |
199 | 206 | self._start_position_ease() |
|
0 commit comments