-
Notifications
You must be signed in to change notification settings - Fork 0
/
round.py
59 lines (50 loc) · 2.08 KB
/
round.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import pygame
from enemy import Enemy1, Enemy2, Enemy3
from weapons import Knife, Pistol, Tompson, Mp40
class Round:
def __init__(self, player):
self.enemies_group = pygame.sprite.Group()
self.blasts_group = pygame.sprite.Group()
self.characters_group = pygame.sprite.Group()
self.characters_group.add(player)
self.available_weapons = []
self.time_to_spawn_weapon = 0
self.last_spawn_weapon = 0
self.next_round = None
self.text = ""
def ifnextround(self):
if len(self.enemies_group) == 0:
return True
class Round1(Round):
def __init__(self, player):
super().__init__(player)
self.list_of_enemies = [Enemy1(20, 20), Enemy1(80, 20), Enemy1(200, 20), Enemy1(300, 20)]
for x in self.list_of_enemies:
self.characters_group.add(x)
self.enemies_group.add(x)
self.available_weapons = [Knife, Pistol]
self.next_round = Round2(player)
self.time_to_spawn_weapon = 7000
self.text = "round 1"
class Round2(Round):
def __init__(self, player):
super().__init__(player)
self.list_of_enemies = [Enemy2(20, 20), Enemy2(80, 20), Enemy2(200, 20), Enemy1(300, 20), Enemy1(700, 500)]
for x in self.list_of_enemies:
self.characters_group.add(x)
self.enemies_group.add(x)
self.available_weapons = [Knife, Pistol, Tompson]
self.next_round = Round3(player)
self.time_to_spawn_weapon = 5000
self.text = "round 2"
class Round3(Round):
def __init__(self, player):
super().__init__(player)
self.list_of_enemies = [Enemy3(20, 200), Enemy3(20, 400), Enemy3(20, 20), Enemy3(80, 20), Enemy2(200, 20), Enemy1(300, 20), Enemy1(700, 500)]
for x in self.list_of_enemies:
self.characters_group.add(x)
self.enemies_group.add(x)
self.available_weapons = [Pistol, Mp40, Tompson]
self.time_to_spawn_weapon = 9000
self.next_round = None
self.text = "round 3"