Compare commits

..

11 commits

Author SHA1 Message Date
SpagettiFisch
64a3381eb9 Merge branch 'Development' of https://git.spafi.eu/InfoProjekt/game
Signed-off-by: SpagettiFisch <63868515+SpagettiFisch@users.noreply.github.com>
2024-03-12 21:50:04 +01:00
3448ec4120 Update classes.py
sound effects für reddy, zombie, skelett, oldman attack, hurt sound effect für oldman, Tür und Portal sounds
2024-03-12 17:52:27 +00:00
c81b3fa355 Upload files to "audio/soundeffects" 2024-03-12 16:48:24 +00:00
4d90ac3e38 Upload files to "audio/soundeffects" 2024-03-12 16:47:40 +00:00
dfc2ea8086 Upload files to "audio/soundeffects" 2024-03-12 16:46:44 +00:00
b124f8817c Upload files to "art/images/people" 2024-03-12 16:18:45 +00:00
d4da02ee8d Delete art/images/people/fairy.png 2024-03-12 16:18:31 +00:00
7a85a049de Delete audio/soundeffects/altefrauspeak.mp3 2024-03-12 15:57:10 +00:00
5db4df24a0 Delete audio/soundeffects/dorfaeltesterspeak.mp3 2024-03-12 15:57:04 +00:00
2f8e393c1e Delete viecher.py
nichts mehr drin
2024-03-12 15:56:39 +00:00
08edd05403 Merge pull request 'room update and boss' (#83) from Spafi/game:main into Development
Reviewed-on: InfoProjekt/game#83
2024-03-12 11:52:26 +00:00
13 changed files with 1077 additions and 1049 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 762 B

Binary file not shown.

Binary file not shown.

BIN
audio/soundeffects/door.mp3 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,7 +1,10 @@
import pygame
import random
# from viecher import Skeleton, Zombie
from pygame import mixer
"""
cultistattack_sound = mixer.Sound('audio/soundeffects/cultistattack.mp3')
"""
pygame.font.init()
fonts = {
'medieval': 'medieval.ttf',
@ -574,10 +577,15 @@ class MainCharacter(Fighter):
self.thinks.draw(screen, self.x + 20, self.y - 100)
def hurt(self, damage, objects):
hit_sound = mixer.Sound('audio/soundeffects/hitsound.mp3')
hit_sound.set_volume(0.5)
if not self.talking:
hit_sound.play()
self.health.hurt(damage)
def obstacle_interaction(self, objects):
portal_sound = mixer.Sound('audio/soundeffects/portalsound.mp3')
door_sound = mixer.Sound('audio/soundeffects/door.mp3')
if len(objects) <= 5:
objects.append([])
touches = pygame.sprite.spritecollideany(self, objects[4] + objects[5])
@ -585,8 +593,10 @@ class MainCharacter(Fighter):
if touches.name == 'fireplace':
self.freezing = False
elif touches.name == 'portal' and self.level.level != 1:
portal_sound.play()
return 'play'
elif touches.name == 'house' and self.level.level != 1:
door_sound.play()
self.x = 500
self.y = 400
return 'house'
@ -594,6 +604,7 @@ class MainCharacter(Fighter):
return 'wall'
elif isinstance(touches, Door):
if not touches.locked:
door_sound.play()
return f'door-{touches.target}'
else:
return True
@ -650,13 +661,22 @@ class MainCharacter(Fighter):
"""
def attack(self, obj, mouse):
fireball_sound = mixer.Sound('audio/soundeffects/firebalhitl.mp3')
wind_sound = mixer.Sound('audio/soundeffects/wind.mp3')
oldmanattack_sound = mixer.Sound('audio/soundeffects/oldmanattack.mp3')
fireball_sound.set_volume(0.2)
wind_sound.set_volume(0.2)
oldmanattack_sound.set_volume(0.2)
if self.lastAttack + self.attack_speed * 1000 < pygame.time.get_ticks():
moveto = mouse - vec(self.x, self.y)
if self.book.current_sp == 'fireball':
fireball_sound.play()
weapon = Fireball('fb1', 100, self.x, self.y, moveto, 5)
elif self.book.current_sp == 'windslash':
wind_sound.play()
weapon = Windslash('ws1', 100, self.x, self.y, moveto, 10)
else:
oldmanattack_sound.play()
weapon = Punch('punch', 100, self.x, self.y, moveto, 1, Mobs, life_ticks=500)
obj[3].append(weapon)
self.lastAttack = pygame.time.get_ticks()
@ -881,7 +901,10 @@ class Skeleton(Mobs):
super().__init__(name, ms, sprite, x, y, health, damage, level, asp, atr, drops)
def attack(self, moveto, obj):
arrow_sound = mixer.Sound('audio/soundeffects/arrowsound.mp3')
arrow_sound.set_volume(0.3)
if self.lastAttack + self.attack_speed * 1000 < pygame.time.get_ticks():
arrow_sound.play()
obj[3].append(Arrow("arrow", 200, self.x, self.y, moveto, self.damage))
self.lastAttack = pygame.time.get_ticks()
@ -923,7 +946,10 @@ class Zombie(Mobs):
def attack(self, moveto, obj):
zombieattack_sound = mixer.Sound('audio/soundeffects/zombieattack.mp3')
zombieattack_sound.set_volume(0.3)
if self.lastAttack + self.attack_speed * 1000 < pygame.time.get_ticks():
zombieattack_sound.play()
obj[3].append(Punch('punch', 100, self.x, self.y, moveto, self.damage, MainCharacter))
self.lastAttack = pygame.time.get_ticks()
@ -941,7 +967,10 @@ class Boss(Mobs):
super().__init__(name, ms, sprite, x, y, health, damage, level, asp, atr, drops)
def attack(self, moveto, obj):
reddyattack_sound = mixer.Sound('audio/soundeffects/reddyattack.mp3')
reddyattack_sound.set_volume(0.8)
if self.lastAttack + self.attack_speed * 1000 < pygame.time.get_ticks():
reddyattack_sound.play()
obj[3].append(RedBlob("blob", 50, self.x, self.y, moveto, self.damage))
self.lastAttack = pygame.time.get_ticks()
@ -1038,7 +1067,6 @@ class Arrow(Weapons):
self.move(objects)
self.die(objects, MainCharacter)
class Punch(Weapons):
def __init__(self, name, ms, x, y, moveto, damage, kills, sprite = 'weapons/empty.png', life_ticks=100) -> None:
super().__init__(name, ms, sprite, x, y, moveto, damage, life_ticks)

View file