new river sprite file added

new idea lol

Signed-off-by: SpagettiFisch <63868515+SpagettiFisch@users.noreply.github.com>
This commit is contained in:
SpagettiFisch 2024-03-07 09:50:10 +01:00
parent 1b6ccb17b0
commit c3c44bbc71
4 changed files with 14 additions and 10 deletions

1
.idea/ideas.txt generated
View file

@ -38,6 +38,7 @@ Story:
Henker Henker
armer Bauer armer Bauer
"Hexe" "Hexe"
Patrice, fragt nach Lightning Anschluss -> Lightning Spell freigeschaltet
Ziel(e) Ziel(e)
-> Zurückkommen -> Zurückkommen

BIN
art/images/river.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -182,15 +182,16 @@ class Scene(GameObjects):
super().__init__(name, _type, bg, objects, WIDTH, HEIGHT) super().__init__(name, _type, bg, objects, WIDTH, HEIGHT)
self.level = level self.level = level
self.current_level = 0 self.current_level = 0
self.update()
def update(self, change:bool, objects): def update(self, change:bool=False, objects=None):
if change: if change:
self.current_level += 1 self.current_level += 1
self.level[self.current_level].update(objects) self.level[self.current_level].update(objects)
self.background = self.level[self.current_level].background self.background = self.level[self.current_level].background
if isinstance(self.objects, list): """if isinstance(self.objects, list):
for obj in self.objects[0] + self.objects[1] + self.objects[2]: for obj in self.objects[0] + self.objects[1] + self.objects[2]:
obj.update() obj.update()"""
def draw(self, screen): def draw(self, screen):
if isinstance(self.objects, list): if isinstance(self.objects, list):
@ -250,7 +251,8 @@ class Room(GameObjects):
return walls return walls
def update(self, objects): def update(self, objects):
self.objects = objects if objects is not None:
self.objects = objects
if not self.objects[1]: if not self.objects[1]:
self.locked = False self.locked = False
return return

13
main.py
View file

@ -27,12 +27,13 @@ def quitGame():
quit() quit()
def genRooms(WIDTH, HEIGHT, type:str, objects:list): def genRooms(WIDTH, HEIGHT, type:str, objects:list):
room_objects = [Obstacle('dirt', 'boulder', 'art/images/dirt2.png', False, 32, 32, WIDTH=WIDTH - 64, HEIGHT=HEIGHT - 64)] room_objects = []
room_objects.append(Obstacle('river', 'water', 'art/images/river1.png', True, 32, 32, WIDTH=WIDTH - 64, HEIGHT=HEIGHT - 64)) #room_objects = [Obstacle('dirt', 'boulder', 'art/images/dirt2.png', False, 32, 32, WIDTH=WIDTH - 64, HEIGHT=HEIGHT - 64)]
room_objects.append(Obstacle('river', 'water', 'art/images/river.png', True, random.randint(32, round(WIDTH * 0.75)), 32, WIDTH=96, HEIGHT=round(HEIGHT * 0.66)))
rooms = [ rooms = [
Room(type, 'normal', f'art/images/{type}.png', [objects[0], objects[1], objects[2], [room_objects[random.randint(0, len(room_objects) - 1)] for i in range(0, 5)]], WIDTH - 64, HEIGHT - 64, [True, True, True, False], 0), Room(type, 'normal', f'art/images/{type}.png', [objects[0], objects[1], objects[2], [room_objects[random.randint(0, len(room_objects) - 1)] for i in range(0, random.randint(0, 1))]], WIDTH - 64, HEIGHT - 64, [True, True, True, False], 0),
Room(type, 'normal', f'art/images/{type}.png', [objects[0], objects[1], objects[2], [room_objects[random.randint(0, len(room_objects) - 1)] for i in range(0, 5)]], WIDTH - 64, HEIGHT - 64, [True, True, True, False], 1), Room(type, 'normal', f'art/images/{type}.png', [objects[0], objects[1], objects[2], [room_objects[random.randint(0, len(room_objects) - 1)] for i in range(0, random.randint(0, 1))]], WIDTH - 64, HEIGHT - 64, [True, True, True, False], 1),
Room(type, 'normal', f'art/images/{type}.png', [objects[0], objects[1], objects[2], [room_objects[random.randint(0, len(room_objects) - 1)] for i in range(0, 5)]], WIDTH - 64, HEIGHT - 64, [True, True, True, False], 2), Room(type, 'normal', f'art/images/{type}.png', [objects[0], objects[1], objects[2], [room_objects[random.randint(0, len(room_objects) - 1)] for i in range(0, random.randint(0, 1))]], WIDTH - 64, HEIGHT - 64, [True, True, True, False], 2),
] ]
return rooms return rooms
@ -66,7 +67,6 @@ def play(screen, clock, running, background, isblack, WIDTH, HEIGHT):
screen.blit(bg, (0, 0)) screen.blit(bg, (0, 0))
""" """
if not freeze: if not freeze:
scene.update(False, objects)
objects = scene.getObjects() objects = scene.getObjects()
screen.blit(scene.background, (32, 32)) screen.blit(scene.background, (32, 32))
for thing in objects[3]: for thing in objects[3]:
@ -88,6 +88,7 @@ def play(screen, clock, running, background, isblack, WIDTH, HEIGHT):
npc.draw(screen) npc.draw(screen)
objects[0][0].book.addspell('windslash') objects[0][0].book.addspell('windslash')
scene.update(False, objects)
else: else: