-
Notifications
You must be signed in to change notification settings - Fork 0
/
V2.py
42 lines (34 loc) · 1.05 KB
/
V2.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
40
41
42
import loadSounds, pygame as pi, loadMap, player
pi.init()
displayInfo = pi.display.Info()
dp = {
"width" : displayInfo.current_w,
"height" : displayInfo.current_h
}
screen = pi.display.set_mode((dp.get("width"), dp.get("height")))
pi.display.set_caption("Marsio")
# Setup sounds
sound = loadSounds.load()
map = loadMap.load()
player = player.Create()
def Main():
while True:
for event in pi.event.get():
if event.type == pi.QUIT():
pi.quit()
exit()
if event.type == pi.KEYDOWN:
if event.key == pi.K_SPACE:
player.jump()
if event.key == pi.K_d:
player.right = True
if event.key == pi.K_a:
player.left = True
if event.type == pi.KEYUP:
if event.key == pi.K_d:
player.right = False
if event.key == pi.K_a:
player.left = False
player.move()
if player.jumping > 0:
player.jump()