-
Notifications
You must be signed in to change notification settings - Fork 0
/
keyboard.py
39 lines (29 loc) · 836 Bytes
/
keyboard.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File used to handle keyboard events.
import glfw
polyMode = False
tree_scale = 1
sun_rot = 0
sun_speed = 0
person_step = 0
person_speed = 0
def key_event(window,key,scancode,action,mods):
global polyMode
global tree_scale
global sun_rot
global sun_speed
global person_step
global person_speed
if key == 80 and action == glfw.PRESS:
polyMode = not polyMode
if key == 265 and action == glfw.PRESS:
tree_scale += 0.1
if key == 264 and action == glfw.PRESS:
tree_scale -= 0.1
if key == 263 and action == glfw.PRESS:
person_speed -= 0.03
if key == 262 and action == glfw.PRESS:
person_speed += 0.03
if key == 65 and action == glfw.PRESS:
sun_speed += 0.01
if key == 83 and action == glfw.PRESS:
sun_speed -= 0.01