MCPcopy Create free account
hub / github.com/Mrinank-Bhowmick/python-beginner-projects / __init__

Method __init__

projects/Space Shooter/main.py:211–222  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

209
210class Enemies:
211 def __init__(self):
212 # Place the enemies at random
213 self.x = random.randint(700, 1000)
214 self.y = random.randint(
215 0,
216 Display().windows.get_height() - Display().enemy_spaceship.get_height() + 1,
217 )
218 # Randomly select between two types of enemies
219 self.type = random.choice([1, 2])
220 # List for the location of the lasers/missiles
221 self.bullets_list = []
222 self.alive = True
223
224 def collision_box(self):
225 return pygame.Rect(

Callers

nothing calls this directly

Calls 1

DisplayClass · 0.70

Tested by

no test coverage detected