-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstartup.py
39 lines (29 loc) · 1.22 KB
/
startup.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
38
39
import pygame
from player import *
from shot import *
from asteroid import *
from asteroidfield import *
from power_up import *
from power_up_spawner import *
from menu import *
class Startup():
def __init__(self):
self.time = pygame.time.Clock()
self.dt = 0
self.updateable = pygame.sprite.Group()
self.drawable = pygame.sprite.Group()
self.asteroids = pygame.sprite.Group()
self.shots = pygame.sprite.Group()
self.powerup = pygame.sprite.Group()
Asteroid.containers = (self.asteroids, self.updateable, self.drawable)
AsteroidField.containers = (self.updateable)
self.asteroidfield = AsteroidField()
Player.containers = (self.updateable, self.drawable)
self.player = Player(SCREEN_WIDTH/2, SCREEN_HEIGHT/2)
Shot.containers = (self.shots, self.updateable, self.drawable)
PowerUp.containers = (self.powerup, self.updateable, self.drawable)
PowerUpSpawner.containers = (self.updateable)
self.powerup_spawner = PowerUpSpawner()
pygame.mouse.set_visible(False)
self.crosshair_img = pygame.image.load("./images/crosshair2.png")
self.crosshair_rect = self.crosshair_img.get_rect()