flappy init

This commit is contained in:
2023-07-28 15:31:16 +02:00
parent 189b81b3a0
commit c7dd04590a

View File

@@ -25,5 +25,12 @@ class Flappy(GameBase):
cv.waitKey(int(wait_timer))
if self.flappy_pos_disc.next_gate_height[0] is not 0:
offset = (self.flappy_pos_disc.next_gate_height[0] + 120) - self.flappy_pos_disc.current_pet_height
if offset > 50:
offset = 50
elif offset < -50:
offset = -50
print(offset)
wait_timer = wait_timer - (offset / 2)
wait_timer = 380 + offset
print(wait_timer)
print("pet_pos: ", self.flappy_pos_disc.current_pet_height)
print("next gate: ", self.flappy_pos_disc.next_gate_height[0] + 120)