Added sound effects

This commit is contained in:
Makussu 2024-06-08 01:40:28 +02:00
parent 9049d1a26f
commit 9561d0d7bd
7 changed files with 55 additions and 1 deletions

View File

@ -16,5 +16,24 @@
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/sound/library/sound.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="file://$MODULE_DIR$/sound/library" />
</CLASSES>
<JAVADOC />
<SOURCES />
<jarDirectory url="file://$MODULE_DIR$/sound/library" recursive="false" />
</library>
</orderEntry>
</component>
</module>

View File

@ -7,8 +7,11 @@
* Spielbarkeit
** DONE User Interaktion mit Maus oder Tastatur
** DONE Ziel und Verbesserungsmöglichkeit (z.B. durch Punkte)
*** TODO Zombies random spawn
*** TODO reales level
vllt https://limezu.itch.io/modernexteriors
** TODO Persistierung des Spielstandes (abspeichern)
* Dokumentation
** TODO Kurze Präsentation (10 min) im letzten Labortermin (eine pro Gruppe)
** TODO JavaDoc-Dokumentation
** DONE JavaDoc-Dokumentation
** TODO Klassendiagramm

View File

@ -3,6 +3,7 @@
*/
public class AniShrink extends Animation {
int numPoints = 50;
boolean playing = true;
public AniShrink(Fenster window, Character player) {
super(window, player);
}
@ -12,6 +13,10 @@ public class AniShrink extends Animation {
animating = true;
player.textsize = shrink(from_size, to_size);
// System.out.println(player.pos.x);
if (playing) {
window.shrinkEffect.play(0.5f, 0.4f);
playing = false;
}
} else {
player.textsize = to_size;
animating = false;

View File

@ -54,8 +54,10 @@ public class AuraFight extends Bubble implements Drawable {
if (!my_aura.draw()) {
if (my_aura.won) {
enemy.damage(5);
window.enemyDamage.play();
} else {
player.damage(5);
window.playerDamage.play();
}
if (getRandomBoolean()) {
my_aura = new AuraBubble(window);

View File

@ -34,6 +34,7 @@ public class Bubble {
public boolean toggle() {
if (this.opened && this.index < text.size()-1) {
this.index = this.index + 1;
window.confirm.play();
} else if (this.opened && this.index < text.size()){
close();
} else {
@ -45,6 +46,7 @@ public class Bubble {
public boolean toggle_without_open() {
if (this.opened && this.index < text.size()-1) {
this.index = this.index + 1;
window.confirm.play();
} else if (this.opened && this.index < text.size()){
close();
} else {

View File

@ -1,5 +1,6 @@
import processing.core.PApplet;
import processing.core.PFont;
import processing.sound.*;
import java.awt.event.KeyEvent;
import java.util.ArrayList;
@ -21,6 +22,12 @@ public class Fenster extends PApplet {
GameScreen gameScreen;
FightScreen fightScreen;
DeathScreen deathScreen;
SoundFile soundTrack;
SoundFile confirm;
SoundFile enemyDamage;
SoundFile playerDamage;
SoundFile healEffect;
SoundFile shrinkEffect;
boolean gametitel = true;
@ -31,6 +38,13 @@ public class Fenster extends PApplet {
boolean gametitel_fade = false;
UI ui = new UI(this);
public static void main(String[] args){
String[] processingArgs = {"auraworld"};
Fenster mySketch = new Fenster();
PApplet.runSketch(processingArgs, mySketch);
}
@Override
public void settings() {
size(800, 800);
@ -38,6 +52,7 @@ public class Fenster extends PApplet {
classSetup();
tiles.settings();
//this.text("lol", 0, 0);
//this.rect(4.0f, 4.0f, 4.0f, 4.0f);
}
@ -54,6 +69,13 @@ public class Fenster extends PApplet {
startScreen.setup();
startScreen.isState = true;
soundTrack = new SoundFile(this, "./soundtrack.mp3");
soundTrack.loop(1, 0.2f);
confirm = new SoundFile(this, "./assets/Text 1.wav");
enemyDamage = new SoundFile(this, "./assets/Hit damage 1.wav");
playerDamage = new SoundFile(this, "./assets/Boss hit 1.wav");
healEffect = new SoundFile(this, "./assets/Big Egg collect 1.wav");
shrinkEffect = new SoundFile(this, "./assets/Balloon start riding 2.wav");
}
@Override

View File

@ -22,6 +22,7 @@ public class Talkable extends Character implements Interactable{
public void interact() {
if(!this.bubble.toggle()) {
window.player.heal(20);
window.healEffect.play();
}
}