More core examples (#13)
* Added core_input_keys example * Added core_basic_window example * Added core_input_mouse example * Added core_input_mouse_wheel example * Added Rectangle struct * Added core_input_gestures example to utilize the Rectangle struct * Removed unused imports * Used the right draw function for the example * PEP8 fixes * Added core 2d camera examples * Added core 2d camera examples
This commit is contained in:
parent
6854ec4a3e
commit
6a3be55fe2
4 changed files with 462 additions and 10 deletions
|
@ -28,10 +28,14 @@ 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): ball_position.x += 2
|
||||
if pyray.is_key_down(pyray.KEY_LEFT): ball_position.x -= 2
|
||||
if pyray.is_key_down(pyray.KEY_UP): ball_position.y -= 2
|
||||
if pyray.is_key_down(pyray.KEY_DOWN): ball_position.y += 2
|
||||
if pyray.is_key_down(pyray.KEY_RIGHT):
|
||||
ball_position.x += 2
|
||||
if pyray.is_key_down(pyray.KEY_LEFT):
|
||||
ball_position.x -= 2
|
||||
if pyray.is_key_down(pyray.KEY_UP):
|
||||
ball_position.y -= 2
|
||||
if pyray.is_key_down(pyray.KEY_DOWN):
|
||||
ball_position.y += 2
|
||||
|
||||
# Draw
|
||||
pyray.begin_drawing()
|
||||
|
|
Reference in a new issue