update examples

This commit is contained in:
Richard Smith 2024-11-16 20:11:08 +00:00 committed by Richard Smith
parent 4071263a59
commit a33f4fcc9a
40 changed files with 232 additions and 321 deletions

View file

@ -19,13 +19,13 @@ pyray.set_target_fps(60) # Set our game to run at 60 frames-per-second
# Main game loop
while not pyray.window_should_close(): # Detect window close button or ESC key
# Update
if pyray.is_key_down(pyray.KEY_RIGHT):
if pyray.is_key_down(pyray.KeyboardKey.KEY_RIGHT):
ball_position.x += 2
if pyray.is_key_down(pyray.KEY_LEFT):
if pyray.is_key_down(pyray.KeyboardKey.KEY_LEFT):
ball_position.x -= 2
if pyray.is_key_down(pyray.KEY_UP):
if pyray.is_key_down(pyray.KeyboardKey.KEY_UP):
ball_position.y -= 2
if pyray.is_key_down(pyray.KEY_DOWN):
if pyray.is_key_down(pyray.KeyboardKey.KEY_DOWN):
ball_position.y += 2
# Draw