From 93bbb0eb8428a9770b3b46594dd032de5e5c68ed Mon Sep 17 00:00:00 2001 From: Lyzzy Date: Sun, 10 Mar 2024 16:05:09 +0100 Subject: [PATCH] Stoorryy --- main.py | 3 +-- viecher.py | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index c0dfdfa..637eaf7 100644 --- a/main.py +++ b/main.py @@ -115,7 +115,6 @@ def village(screen, clock, running, background, isblack, WIDTH, HEIGHT): mobs = [] weapons = [] others = [Obstacle('fireplace', 'interactable', 'art/images/background/fireplace.png', False, 200, 500), - Obstacle('portal', 'interactable', 'art/images/background/portal.png', False, 700, 300), Obstacle('house', 'Interactable', 'art/images/background/house.png', False, 500, 150, WIDTH=180, HEIGHT=160)] npcs = [NPC('oldlady', 100, 'people/oldlady.png', 0, 200, 200)] objects = [main, mobs, npcs, weapons, others] @@ -187,7 +186,7 @@ def house(screen, clock, running, background, isblack, WIDTH, HEIGHT): mobs = [] weapons = [] others = [] - npcs = [NPC('oldman', 100, 'people/reddy.png', 0, 200, 200)] + npcs = [NPC('elder', 100, 'people/reddy.png', 0, 200, 200)] objects = [main, mobs, npcs, weapons, others] room = Room('house', 'house', 'art/images/background/insideHouse.png', objects, WIDTH - 64, HEIGHT - 64, [True, True, True, True], 0) freeze = False #Gameplay is freezed in certain situations diff --git a/viecher.py b/viecher.py index c46e625..eb3b420 100644 --- a/viecher.py +++ b/viecher.py @@ -1,6 +1,7 @@ import pygame as pg from classes import * from main import * +import random vec = pg.math.Vector2 fps = 60 @@ -97,8 +98,9 @@ class Convo(Label): self.convo_scene = convo_scene self.convos = [ ['oldlady', 0, ['There are so many rats here.', 'I wish someone would to something against that.','An experienced fighter could kill them.', 'For them it only takes a mouseclick.']], - ['oldlady', 1, ['Oh, did you kill all the rats?', 'You must be the chosen one!', 'It would be nice if you would go and talk to the old wise man in the house.']], - ['oldman', 0, ['Who are you?', 'You want to help us?', 'We have a serious problem with some monsters.', 'One day they appeared out of nowhere and started attacking.', 'When you jump into the portal outside,', 'You will be send to some monsters.', 'PLEASE help us!']] + ['oldlady', 1, ['Oh, did you kill all the rats?', 'You must be the chosen one!', 'It would be nice if you would go and talk to the village elder.']], + ['elder', 0, ['Who are you?', 'You want to help us?', 'We have a serious problem with some monsters.', 'One day they appeared out of nowhere and started attacking.', 'When you jump into the portal outside,', 'You will be send to some monsters.', 'PLEASE help us!']], + ['elder', 1, ['Who are you?', 'You want to help us?', 'We have a serious problem with some monsters.', 'One day they appeared out of nowhere and started attacking.', 'When you jump into the portal outside,', 'You will be send to some monsters.', 'PLEASE help us!']] ] def draw(self, screen): @@ -121,10 +123,15 @@ class Convo(Label): else: if convo[0] == 'oldlady': if convo[1] == 0: - objects[1].append(Rat('rat', 200, 1000, 350, 1, 1, 1, 100, 25)) + for i in range(0,5): + objects[1].append(Rat('rat', random.randint(150,250), 800, 400+i*20, 1, 1, 1, 100, 25)) elif convo[1] == 1: objects[0][0].level.level = 5 - while 'rat' in objects[0][0].killed: objects[0][0].remove('rat') + while 'rat' in objects[0][0].killed: objects[0][0].killed.remove('rat') + if convo[0] == 'elder': + if convo[1] == 0: + objects[4].append(Obstacle('portal', 'interactable', 'art/images/background/portal.png', False, 700, 300)) + self.convo_scene += 1 self.convo_act = 0 self.npc.talking = False objects[0][0].talking = False @@ -178,6 +185,8 @@ class MainCharacter(Fighter): elif touches.name == 'portal' and self.level.level != 1: return 'play' elif touches.name == 'house' and self.level.level != 1: + self.x = 500 + self.y = 400 return 'house' elif 'wall' in touches.name: return 'wall'