fix rotated shift movement

This commit is contained in:
ohsqueezy 2022-12-16 11:18:02 -05:00
parent d62f8876e5
commit 9068830c41
2 changed files with 2 additions and 4 deletions

2
config
View File

@ -18,7 +18,7 @@ title-font-path = font/Oxygen.ttf
scoreboard-font-path = font/terminus/Terminus.ttf
initials-font = font/terminus/Terminus-Bold.ttf
show-framerate = yes
rotate = no
rotate = yes
[mouse]
visible = no

View File

@ -94,10 +94,8 @@ class ElectricSieve(Game):
"""
cancel = not (GPIO.input(pin) == GPIO.LOW)
if pin == ElectricSieve.PIN_BUTTON_LEFT:
print("left")
self.input.post_command("left", cancel=cancel)
elif pin == ElectricSieve.PIN_BUTTON_RIGHT:
print("right")
self.input.post_command("right", cancel=cancel)
self.input.post_any_command(id=pin, cancel=cancel)
@ -298,7 +296,7 @@ class Shift(GameChild):
self.time = max(self.time - self.timer.get_last_frame_duration(), least)
def get_change(self):
return self.nodeset.get_y(self.time) * self.direction
return self.nodeset.get_y(self.time) * (self.direction if not self.get_game().rotated() else -self.direction)
class Scoreboard(GameChild):