Skip to content

Commit fc50259

Browse files
committed
Updated setup.py, added easings.py
1 parent 4ac782c commit fc50259

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

examples/core/core_input_keys.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# core_input_keys.py
2+
from raylibpy import *
3+
4+
5+
def main():
6+
7+
screen_width: int = 800
8+
screen_height: int = 450
9+
10+
init_window(screen_width, screen_height, "raylib [core] example - keyboard input")
11+
12+
ball_position: Vector2 = Vector2(screen_width / 2., screen_height / 2.)
13+
14+
set_target_fps(60)
15+
16+
while not window_should_close():
17+
18+
if is_key_down(KEY_RIGHT):
19+
ball_position.x += 2.0
20+
if is_key_down(KEY_LEFT):
21+
ball_position.x += 2.0
22+
if is_key_down(KEY_UP):
23+
ball_position.y += 2.0
24+
if is_key_down(KEY_DOWN):
25+
ball_position.y += 2.0
26+
27+
begin_drawing()
28+
29+
clear_background(RAYWHITE)
30+
31+
draw_text("move the ball with arrow keys", 10, 10, 20, DARKGRAY)
32+
33+
draw_circle_v(ball_position, 50, MAROON)
34+
35+
end_drawing()
36+
37+
close_window()
38+
39+
40+
if __name__ == '__main__':
41+
main()

0 commit comments

Comments
 (0)