Kreis für die Taschenlampe
This commit is contained in:
parent
b56bde75ef
commit
78a87589d1
1 changed files with 6 additions and 1 deletions
7
game.py
7
game.py
|
|
@ -33,6 +33,7 @@ class Game:
|
|||
# Background
|
||||
self.display.fill((0, 0, 0, 0))
|
||||
|
||||
# Event-Keys
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.QUIT:
|
||||
self.running = False
|
||||
|
|
@ -41,8 +42,12 @@ class Game:
|
|||
if event.key == pygame.K_ESCAPE:
|
||||
self.running = False
|
||||
|
||||
pygame.draw.rect(self.display, (255, 0, 0), pygame.Rect(self.player_pos[0], self.player_pos[1], 20, 20))
|
||||
# Player-Draw
|
||||
pygame.draw.circle(self.display, (255, 255, 255, 0), self.player_pos, 30)
|
||||
|
||||
pygame.draw.rect(self.display, (255, 0, 0), pygame.Rect(self.player_pos[0]-10, self.player_pos[1]-10, 20, 20))
|
||||
|
||||
# Smooth Movement
|
||||
keys = pygame.key.get_pressed()
|
||||
if keys[pygame.K_w]:
|
||||
self.player_pos.y -= 300 * self.dt
|
||||
|
|
|
|||
Loading…
Reference in a new issue