Spawner-Logik hinzugefügt
This commit is contained in:
parent
1e4059dc0d
commit
62c6ae19d8
3 changed files with 10 additions and 1 deletions
|
|
@ -23,6 +23,7 @@ class Editor:
|
|||
"grass": load_images(path="tiles/grass"),
|
||||
"large_decor": load_images(path="tiles/large_decor"),
|
||||
"stone": load_images(path="tiles/stone"),
|
||||
"spawners": load_images("tiles/spawners"),
|
||||
}
|
||||
|
||||
self.movement: list[bool] = [False, False, False, False]
|
||||
|
|
|
|||
8
game.py
8
game.py
|
|
@ -78,6 +78,12 @@ class Game:
|
|||
pygame.Rect(4 + tree["pos"][0], 4 + tree["pos"][1], 23, 13)
|
||||
)
|
||||
|
||||
for spawner in self.tilemap.extract([("spawners", 0), ("spawners", 1)]):
|
||||
if spawner["variant"] == 0:
|
||||
self.player.pos = spawner["pos"]
|
||||
else:
|
||||
print(spawner["pos"], "enemy")
|
||||
|
||||
self.particles: list[Particle] = []
|
||||
|
||||
self.clouds: Clouds = Clouds(cloud_images=self.assets["clouds"], count=16)
|
||||
|
|
@ -116,6 +122,8 @@ class Game:
|
|||
frame=random.randint(0, 20),
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
self.clouds.update()
|
||||
self.clouds.render(surface=self.display, offset=render_scroll)
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ class Player(PhysicsEntity):
|
|||
# self.velocity[1] -= 5
|
||||
# boost_particle = Particle(self.game, "boost", (self.pos[0] + self.size[0]//2, self.pos[1] + self.size[1]//2))
|
||||
# self.game.particles.append(boost_particle)
|
||||
self.velocity[1] -= 100000
|
||||
self.velocity[1] -= 5
|
||||
boost_particle = Particle(
|
||||
self.game,
|
||||
"boost",
|
||||
|
|
|
|||
Loading…
Reference in a new issue