final changes for better touch function

This commit is contained in:
2025-05-03 02:06:10 +02:00
parent 96a8b4d8e5
commit f59b0895bb

View File

@@ -715,7 +715,7 @@ async def main():
result = await touch(event) result = await touch(event)
elif event.type == pygame.FINGERDOWN and not touch_start: elif event.type == pygame.FINGERDOWN and not touch_start:
await touch(event) await touch(event)
print(result)
if await is_LEFT_event(event) or (result == "ontop"): if await is_LEFT_event(event) or (result == "ontop"):
can_tip = current_case.length_units * UNIT_HEIGHT <= TRAILER_HEIGHT can_tip = current_case.length_units * UNIT_HEIGHT <= TRAILER_HEIGHT
if current_case and current_case.allow_snap and can_use_tilt and can_tip: if current_case and current_case.allow_snap and can_use_tilt and can_tip:
@@ -739,7 +739,7 @@ async def main():
spawn_case_in_game() spawn_case_in_game()
shake_timer = 10 shake_timer = 10
elif await is_SPACE_event(event) or (result == "snap"): elif await is_SPACE_event(event) or (result == "snap"):
print(result)
if current_case and current_case.allow_snap: if current_case and current_case.allow_snap:
await current_case.animate_snap() await current_case.animate_snap()
can_use_tilt = True can_use_tilt = True