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 /> <SOURCES />
</library> </library>
</orderEntry> </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> </component>
</module> </module>

View File

@ -7,8 +7,11 @@
* Spielbarkeit * Spielbarkeit
** DONE User Interaktion mit Maus oder Tastatur ** DONE User Interaktion mit Maus oder Tastatur
** DONE Ziel und Verbesserungsmöglichkeit (z.B. durch Punkte) ** 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) ** TODO Persistierung des Spielstandes (abspeichern)
* Dokumentation * Dokumentation
** TODO Kurze Präsentation (10 min) im letzten Labortermin (eine pro Gruppe) ** TODO Kurze Präsentation (10 min) im letzten Labortermin (eine pro Gruppe)
** TODO JavaDoc-Dokumentation ** DONE JavaDoc-Dokumentation
** TODO Klassendiagramm ** TODO Klassendiagramm

View File

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

View File

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

View File

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

View File

@ -1,5 +1,6 @@
import processing.core.PApplet; import processing.core.PApplet;
import processing.core.PFont; import processing.core.PFont;
import processing.sound.*;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.util.ArrayList; import java.util.ArrayList;
@ -21,6 +22,12 @@ public class Fenster extends PApplet {
GameScreen gameScreen; GameScreen gameScreen;
FightScreen fightScreen; FightScreen fightScreen;
DeathScreen deathScreen; DeathScreen deathScreen;
SoundFile soundTrack;
SoundFile confirm;
SoundFile enemyDamage;
SoundFile playerDamage;
SoundFile healEffect;
SoundFile shrinkEffect;
boolean gametitel = true; boolean gametitel = true;
@ -31,6 +38,13 @@ public class Fenster extends PApplet {
boolean gametitel_fade = false; boolean gametitel_fade = false;
UI ui = new UI(this); UI ui = new UI(this);
public static void main(String[] args){
String[] processingArgs = {"auraworld"};
Fenster mySketch = new Fenster();
PApplet.runSketch(processingArgs, mySketch);
}
@Override @Override
public void settings() { public void settings() {
size(800, 800); size(800, 800);
@ -38,6 +52,7 @@ public class Fenster extends PApplet {
classSetup(); classSetup();
tiles.settings(); tiles.settings();
//this.text("lol", 0, 0); //this.text("lol", 0, 0);
//this.rect(4.0f, 4.0f, 4.0f, 4.0f); //this.rect(4.0f, 4.0f, 4.0f, 4.0f);
} }
@ -54,6 +69,13 @@ public class Fenster extends PApplet {
startScreen.setup(); startScreen.setup();
startScreen.isState = true; 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 @Override

View File

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