Compare commits
No commits in common. "34dbe4dc5798736fe3be0ff4250d4569b58815df" and "1b990a81d5c247d89aeaa1c88ab1ed22d1735d2d" have entirely different histories.
34dbe4dc57
...
1b990a81d5
21
main.py
21
main.py
@ -3,7 +3,7 @@ import sys
|
|||||||
|
|
||||||
pygame.init()
|
pygame.init()
|
||||||
screen = pygame.display.set_mode((1280, 720))
|
screen = pygame.display.set_mode((1280, 720))
|
||||||
wozek = pygame.Rect(55,55,50,50)
|
|
||||||
c = (0, 150, 0)
|
c = (0, 150, 0)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
@ -12,27 +12,8 @@ while True:
|
|||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
elif event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE:
|
elif event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE:
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
elif event.type == pygame.KEYDOWN and event.key == pygame.K_DOWN:
|
|
||||||
if wozek.y <= 600:
|
|
||||||
wozek.y += 80
|
|
||||||
elif event.type == pygame.KEYDOWN and event.key == pygame.K_UP:
|
|
||||||
if wozek.y >= 100:
|
|
||||||
wozek.y -= 80
|
|
||||||
elif event.type == pygame.KEYDOWN and event.key == pygame.K_RIGHT:
|
|
||||||
if wozek.x <= 1170:
|
|
||||||
wozek.x += 80
|
|
||||||
elif event.type == pygame.KEYDOWN and event.key == pygame.K_LEFT:
|
|
||||||
if wozek.x >= 100:
|
|
||||||
wozek.x -= 80
|
|
||||||
|
|
||||||
|
|
||||||
for x in range(0, 1280, 80):
|
for x in range(0, 1280, 80):
|
||||||
pygame.draw.line(screen, c, (1, x), (1280, x), 2)
|
pygame.draw.line(screen, c, (1, x), (1280, x), 2)
|
||||||
pygame.draw.line(screen, c, (x, 1), (x, 720), 2)
|
pygame.draw.line(screen, c, (x, 1), (x, 720), 2)
|
||||||
pygame.display.update()
|
pygame.display.update()
|
||||||
|
|
||||||
|
|
||||||
#Drawing
|
|
||||||
screen.fill((0,0,0)) #removes object trail
|
|
||||||
pygame.draw.rect(screen, (0,150,255), wozek) #resolution, color, object
|
|
||||||
pygame.display.flip() #updating frames
|
|
||||||
|
Loading…
Reference in New Issue
Block a user