Development #57

Merged
Spafi merged 66 commits from Development into main 2024-03-03 13:28:46 +01:00
3 changed files with 32 additions and 20 deletions
Showing only changes of commit 8f78002015 - Show all commits

BIN
art/images/start.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

View file

@ -137,10 +137,24 @@ class DropDown():
return -1
class Scene():
def __init__(self, _type, bg, objects) -> None:
self.name
class GameObjects():
def __init__(self, name:str, _type:str, bg, objects:list) -> None:
self.name = name
self.type = _type
if self.type != 'cutscene':
self.background = bg
self.objects = objects
self.background = bg
self.objects = objects
class Scene(GameObjects):
def __init__(self, name:str, _type:str, bg, objects:list) -> None:
super().__init__(name, _type, bg, objects)
class Room(GameObjects):
def __init__(self, name:str, _type:str, bg, objects:list, exits:list) -> None:
super().__init__(name, _type, bg, objects)
self.exits = exits
if self.type == 'normal' or self.type == 'boss':
self.locked = True
else:
self.locked = False

26
main.py
View file

@ -24,10 +24,7 @@ def readConfig():
def quitGame():
#save progress somehow, if needed
pygame.quit()
sys.exit()
def uwu():
print('uwu')
quit()
def play(screen, clock, running, background, isblack, WIDTH, HEIGHT):
objects = []
@ -92,15 +89,16 @@ def options(screen, clock, running, background, isblack, WIDTH, HEIGHT):
def menu(screen, clock, running, background, isblack, WIDTH, HEIGHT):
objects = []
objects.append(Button(WIDTH / 2 - 80, HEIGHT / 2 + 72, 160, 64, 'medieval', 48, "Exit game", quitGame))
objects.append(Button(WIDTH / 2 - 80, HEIGHT / 2, 160, 64, 'medieval', 48, "Play", play))
objects.append(Button(WIDTH / 2 - 80, HEIGHT / 2 - 72, 160, 64, 'medieval', 48, "Options", uwu))
#objects.append(Button(WIDTH / 2 - 80, HEIGHT / 2 - 72, 160, 64, 'medieval', 48, "Options", uwu))
objects.append(Button(WIDTH / 2 - 80, HEIGHT / 2 + 72, 160, 64, 'medieval', 48, "Exit game", quitGame))
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
running = False
quitGame()
# RENDER YOUR GAME HERE
with open(background, 'r') as i:
with open(f'art/images/{background}', 'r') as i:
bg = pygame.image.load(i)
bg = pygame.transform.scale(bg, (WIDTH, HEIGHT))
# fill the screen with an image to clear the screen
@ -117,11 +115,11 @@ def main():
config = readConfig()
screen, clock, running, isblack, background, objects = setUp(config["screen"])
WIDTH, HEIGHT = screen.get_size()
objects.append(Button(WIDTH / 2 - 80, HEIGHT / 2 + 72, 160, 64, 'medieval', 48, "Exit game", quitGame))
objects.append(Button(WIDTH / 2 - 80, HEIGHT / 2, 160, 64, 'medieval', 48, "Options", uwu))
objects.append(Button(WIDTH / 2 - 80, HEIGHT / 2 - 72, 160, 64, 'medieval', 48, "Play", play))
while running:
#objects.append(Button(WIDTH / 2 - 80, HEIGHT / 2 - 72, 160, 64, 'medieval', 48, "Play", play))
#objects.append(Button(WIDTH / 2 - 80, HEIGHT / 2, 160, 64, 'medieval', 48, "Options", uwu))
#objects.append(Button(WIDTH / 2 - 80, HEIGHT / 2 + 72, 160, 64, 'medieval', 48, "Exit game", quitGame))
menu(screen, clock, running, background, isblack, WIDTH, HEIGHT)
"""while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
@ -141,7 +139,7 @@ def main():
# flip() the display to put your work on screen
pygame.display.flip()
clock.tick(60) # limits FPS to 60
clock.tick(60) # limits FPS to 60"""
pygame.quit()