main
parent
ff68e5c206
commit
3ebb299f00
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 2.9 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 7.8 KiB |
7
main.py
7
main.py
|
|
@ -14,7 +14,7 @@ g_y_velocity = 20
|
||||||
g_jumping = False
|
g_jumping = False
|
||||||
g_facing_right = True
|
g_facing_right = True
|
||||||
|
|
||||||
K_X, K_Y = 300, 800
|
K_X, K_Y = 300, 700
|
||||||
K_GRAVITY = 1
|
K_GRAVITY = 1
|
||||||
K_JUMP_HEIGHT = 20
|
K_JUMP_HEIGHT = 20
|
||||||
k_y_velocity = 20
|
k_y_velocity = 20
|
||||||
|
|
@ -76,8 +76,7 @@ while True:
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
keys_pressed = pygame.key.get_pressed()
|
keys_pressed = pygame.key.get_pressed()
|
||||||
|
|
||||||
# remember previous vertical positions to detect landing direction
|
|
||||||
prev_G_Y = G_Y
|
prev_G_Y = G_Y
|
||||||
prev_K_Y = K_Y
|
prev_K_Y = K_Y
|
||||||
|
|
||||||
|
|
@ -194,7 +193,7 @@ while True:
|
||||||
g_y_velocity = 0
|
g_y_velocity = 0
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Knight
|
# Knight
|
||||||
if k_rect.colliderect(platform_rect):
|
if k_rect.colliderect(platform_rect):
|
||||||
if k_y_velocity < 0:
|
if k_y_velocity < 0:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue