Merge branch 'main' into feat/startscreen
@@ -1,3 +1,28 @@
|
||||
# Silent FH
|
||||
|
||||
Lorem ipsum for now.
|
||||
In Silent FH, you play as a student trapped overnight in the FH Joanneum. During the night the professors turn into monsters and hunt down the trapped students.
|
||||
Your goal is to survive.
|
||||
|
||||
This project uses uv and PyGame as its main libraries.
|
||||
|
||||
To get uv, please see here: https://docs.astral.sh/uv/getting-started/installation/
|
||||
|
||||
To sync the dependencies, please run:
|
||||
|
||||
```
|
||||
uv sync
|
||||
source .venv/bin/activate or source .venv/bin/activate.fish
|
||||
uv run main.py
|
||||
```
|
||||
|
||||
Coding Guidelines:
|
||||
|
||||
- Using branches for features, named like so: feat/feature-name
|
||||
- Using pull requests and merging for code review
|
||||
- Using semantic commits for a good overview of the changes, for example:
|
||||
- feat(component): added new component
|
||||
- fix(bug): fixed a bug
|
||||
- docs(readme): updated documentation
|
||||
- chore(ci): automated build and deployment
|
||||
|
||||
Game coded up by Baumgartner Kevin, Kammerhofer Lukas, Berger Lena and Haiden Niklas.
|
||||
|
After Width: | Height: | Size: 129 KiB |
|
After Width: | Height: | Size: 127 KiB |
|
After Width: | Height: | Size: 127 KiB |
|
After Width: | Height: | Size: 112 KiB |
|
After Width: | Height: | Size: 110 KiB |
|
After Width: | Height: | Size: 116 KiB |
|
After Width: | Height: | Size: 106 KiB |
|
After Width: | Height: | Size: 110 KiB |
|
After Width: | Height: | Size: 108 KiB |
|
After Width: | Height: | Size: 114 KiB |
|
After Width: | Height: | Size: 113 KiB |
|
After Width: | Height: | Size: 112 KiB |
|
After Width: | Height: | Size: 122 KiB |
|
After Width: | Height: | Size: 122 KiB |
|
After Width: | Height: | Size: 123 KiB |
|
After Width: | Height: | Size: 104 KiB |
|
After Width: | Height: | Size: 94 KiB |
|
After Width: | Height: | Size: 106 KiB |
|
After Width: | Height: | Size: 102 KiB |
|
After Width: | Height: | Size: 88 KiB |
|
After Width: | Height: | Size: 103 KiB |
|
After Width: | Height: | Size: 104 KiB |
|
After Width: | Height: | Size: 105 KiB |
|
After Width: | Height: | Size: 104 KiB |
|
After Width: | Height: | Size: 136 KiB |
|
After Width: | Height: | Size: 138 KiB |
|
After Width: | Height: | Size: 146 KiB |
|
After Width: | Height: | Size: 129 KiB |
|
After Width: | Height: | Size: 127 KiB |
|
After Width: | Height: | Size: 128 KiB |
|
After Width: | Height: | Size: 123 KiB |
|
After Width: | Height: | Size: 124 KiB |
|
After Width: | Height: | Size: 124 KiB |
|
After Width: | Height: | Size: 124 KiB |
|
After Width: | Height: | Size: 129 KiB |
|
After Width: | Height: | Size: 128 KiB |
|
After Width: | Height: | Size: 664 KiB |
|
After Width: | Height: | Size: 102 KiB |
|
After Width: | Height: | Size: 100 KiB |
|
After Width: | Height: | Size: 96 KiB |
|
After Width: | Height: | Size: 92 KiB |
|
After Width: | Height: | Size: 90 KiB |
|
After Width: | Height: | Size: 89 KiB |
|
After Width: | Height: | Size: 88 KiB |
|
After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 81 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 81 KiB |
|
After Width: | Height: | Size: 105 KiB |
|
After Width: | Height: | Size: 104 KiB |
|
After Width: | Height: | Size: 103 KiB |
|
After Width: | Height: | Size: 101 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 106 KiB |
|
After Width: | Height: | Size: 93 KiB |
|
After Width: | Height: | Size: 77 KiB |
|
After Width: | Height: | Size: 96 KiB |
|
After Width: | Height: | Size: 100 KiB |
|
After Width: | Height: | Size: 98 KiB |
|
After Width: | Height: | Size: 96 KiB |
|
After Width: | Height: | Size: 98 KiB |
|
After Width: | Height: | Size: 95 KiB |
|
After Width: | Height: | Size: 96 KiB |
|
After Width: | Height: | Size: 84 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 84 KiB |
|
After Width: | Height: | Size: 84 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 90 KiB |
|
After Width: | Height: | Size: 88 KiB |
|
After Width: | Height: | Size: 88 KiB |
|
After Width: | Height: | Size: 127 KiB |
|
After Width: | Height: | Size: 127 KiB |
|
After Width: | Height: | Size: 124 KiB |
|
After Width: | Height: | Size: 116 KiB |
|
After Width: | Height: | Size: 90 KiB |
|
After Width: | Height: | Size: 117 KiB |
|
After Width: | Height: | Size: 114 KiB |
|
After Width: | Height: | Size: 99 KiB |
|
After Width: | Height: | Size: 113 KiB |
|
After Width: | Height: | Size: 108 KiB |
|
After Width: | Height: | Size: 105 KiB |
|
After Width: | Height: | Size: 104 KiB |
@@ -0,0 +1,30 @@
|
||||
import pygame
|
||||
from src.settings import DESK_WIDTH, DESK_HEIGHT
|
||||
|
||||
class Desk:
|
||||
def __init__(self, x, y):
|
||||
# each desk must be positioned with its own x/y coordinates
|
||||
self.x = x
|
||||
self.y = y
|
||||
|
||||
# size for collision rect and table
|
||||
self.rect = pygame.Rect(self.x, self.y, DESK_WIDTH, DESK_HEIGHT)
|
||||
|
||||
try:
|
||||
self.image = pygame.image.load("assets/furniture/desk.png").convert_alpha()
|
||||
# scale the sprite to match collision rect
|
||||
self.image = pygame.transform.scale(self.image, (DESK_WIDTH, DESK_HEIGHT))
|
||||
except Exception as e:
|
||||
print(f"Error loading desk sprite: {e}")
|
||||
self.image = None
|
||||
|
||||
# check if player touches table
|
||||
def check_collision(self, player_rect):
|
||||
return self.rect.colliderect(player_rect)
|
||||
|
||||
# draw table - use sprite and as fallback a brown rect
|
||||
def draw(self, screen):
|
||||
if self.image:
|
||||
screen.blit(self.image, self.rect)
|
||||
else:
|
||||
pygame.draw.rect(screen, (193, 69, 19), self.rect)
|
||||
@@ -0,0 +1,31 @@
|
||||
import pygame
|
||||
|
||||
# using class to be able to reuse it
|
||||
# as we will have multiple rooms to go in
|
||||
class Door:
|
||||
def __init__(self, x, y, hp_value):
|
||||
# for each door we can set our own x/y position
|
||||
self.x = x
|
||||
self.y = y
|
||||
|
||||
self.max_hp = hp_value
|
||||
self.current_hp = hp_value
|
||||
self.is_closed = False
|
||||
|
||||
self.door_color = (245, 245, 220)
|
||||
self.door_border_color = (100, 90, 80)
|
||||
|
||||
def draw(self, screen):
|
||||
# main space of the door with 20x100 px
|
||||
pygame.draw.rect(screen, self.door_color, (self.x, self.y, 20, 100))
|
||||
|
||||
# doorframe 3px
|
||||
pygame.draw.rect(screen, self.door_border_color, (self.x, self.y, 20, 100), 3)
|
||||
|
||||
# when attacked and gets dmg reduces the health (if closed), door "breaks" when health = 0
|
||||
def take_damage(self, amount):
|
||||
if self.is_closed:
|
||||
self.current_hp -= amount
|
||||
if self.current_hp <= 0:
|
||||
self.current_hp = 0
|
||||
self.is_closed = False
|
||||
@@ -0,0 +1,4 @@
|
||||
# --- DESK ---
|
||||
DESK_WIDTH = 70
|
||||
DESK_HEIGHT = 40
|
||||
|
||||