@bossotron13/

KnownRealisticBackslash

Pygame

No description

fork
loading
Files
  • main.py
main.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
import pygame

Game = pygame.display.set_mode((500, 500))
GameWilltoLive = True
pygame.display.set_caption('Walking Game')


x = 50
y = 50
width = 14
height = 40
speed = 5



while GameWilltoLive:
    pygame.time.delay(100)

    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            GameWilltoLive = False
        keys = pygame.key.get_pressed()

        if keys[pygame.K_w]:
            y -= speed
        if keys[pygame.K_s]:
            y += speed
        if keys[pygame.K_a]:
            x -= speed
        if keys[pygame.K_d]:
            x += speed

    pygame.draw.rect(Game, (200, 100, 50), (x, y, width, height))
    pygame.display.update()