-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
35 lines (25 loc) · 729 Bytes
/
main.py
File metadata and controls
35 lines (25 loc) · 729 Bytes
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
import pygame
from constante import *
from player import Player
pygame.init()
ecran = pygame.display.set_mode((800,600))
player = Player()
clock = pygame.time.Clock()
running = True
while running:
tick = clock.tick(60)/1000
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_SPACE:
player.shoot()
mouse = pygame.mouse.get_pos()
player.rotating()
ecran.blit(fondIMG, (0,0))
ecran.blit(player.image, (player.rect.x, player.rect.y))
for i in player.lasers:
i.move()
ecran.blit(i.image, i.rect)
pygame.display.update()
pygame.quit()