update core examples
This commit is contained in:
parent
83b810b1eb
commit
eb68dec2ad
17 changed files with 52 additions and 214 deletions
|
@ -4,21 +4,13 @@ raylib [core] example - Keyboard input
|
|||
|
||||
"""
|
||||
import pyray
|
||||
from raylib.colors import (
|
||||
RAYWHITE,
|
||||
DARKGRAY,
|
||||
MAROON,
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
# Initialization
|
||||
SCREEN_WIDTH = 800
|
||||
SCREEN_HEIGHT = 450
|
||||
|
||||
pyray.init_window(SCREEN_WIDTH, SCREEN_HEIGHT,
|
||||
'raylib [core] example - keyboard input')
|
||||
pyray.init_window(SCREEN_WIDTH, SCREEN_HEIGHT, 'raylib [core] example - keyboard input')
|
||||
ball_position = pyray.Vector2(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2)
|
||||
|
||||
pyray.set_target_fps(60) # Set our game to run at 60 frames-per-second
|
||||
|
@ -39,9 +31,9 @@ while not pyray.window_should_close(): # Detect window close button or ESC key
|
|||
# Draw
|
||||
pyray.begin_drawing()
|
||||
|
||||
pyray.clear_background(RAYWHITE)
|
||||
pyray.draw_text('move the ball with arrow keys', 10, 10, 20, DARKGRAY)
|
||||
pyray.draw_circle_v(ball_position, 50, MAROON)
|
||||
pyray.clear_background(pyray.RAYWHITE)
|
||||
pyray.draw_text('move the ball with arrow keys', 10, 10, 20, pyray.DARKGRAY)
|
||||
pyray.draw_circle_v(ball_position, 50, pyray.MAROON)
|
||||
|
||||
pyray.end_drawing()
|
||||
|
||||
|
|
Reference in a new issue