0.1 Merge #85

Merged
Spafi merged 133 commits from Development into main 2024-03-12 22:02:51 +01:00
2 changed files with 14 additions and 6 deletions
Showing only changes of commit 93bbb0eb84 - Show all commits

View file

@ -115,7 +115,6 @@ def village(screen, clock, running, background, isblack, WIDTH, HEIGHT):
mobs = [] mobs = []
weapons = [] weapons = []
others = [Obstacle('fireplace', 'interactable', 'art/images/background/fireplace.png', False, 200, 500), 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)] 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)] npcs = [NPC('oldlady', 100, 'people/oldlady.png', 0, 200, 200)]
objects = [main, mobs, npcs, weapons, others] objects = [main, mobs, npcs, weapons, others]
@ -187,7 +186,7 @@ def house(screen, clock, running, background, isblack, WIDTH, HEIGHT):
mobs = [] mobs = []
weapons = [] weapons = []
others = [] 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] 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) 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 freeze = False #Gameplay is freezed in certain situations

View file

@ -1,6 +1,7 @@
import pygame as pg import pygame as pg
from classes import * from classes import *
from main import * from main import *
import random
vec = pg.math.Vector2 vec = pg.math.Vector2
fps = 60 fps = 60
@ -97,8 +98,9 @@ class Convo(Label):
self.convo_scene = convo_scene self.convo_scene = convo_scene
self.convos = [ 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', 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.']], ['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.']],
['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!']] ['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): def draw(self, screen):
@ -121,10 +123,15 @@ class Convo(Label):
else: else:
if convo[0] == 'oldlady': if convo[0] == 'oldlady':
if convo[1] == 0: 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: elif convo[1] == 1:
objects[0][0].level.level = 5 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.convo_act = 0
self.npc.talking = False self.npc.talking = False
objects[0][0].talking = False objects[0][0].talking = False
@ -178,6 +185,8 @@ class MainCharacter(Fighter):
elif touches.name == 'portal' and self.level.level != 1: elif touches.name == 'portal' and self.level.level != 1:
return 'play' return 'play'
elif touches.name == 'house' and self.level.level != 1: elif touches.name == 'house' and self.level.level != 1:
self.x = 500
self.y = 400
return 'house' return 'house'
elif 'wall' in touches.name: elif 'wall' in touches.name:
return 'wall' return 'wall'