More sounds
This commit is contained in:
parent
9561d0d7bd
commit
020846cf73
@ -9,6 +9,7 @@ public class AuraBubble {
|
||||
Fenster window;
|
||||
Random rand = new Random();
|
||||
boolean won;
|
||||
boolean nothing = false;
|
||||
boolean popped = false;
|
||||
float x, y;
|
||||
float extent = 100;
|
||||
|
||||
@ -12,6 +12,13 @@ public class AuraFail extends AuraBubble {
|
||||
color = window.color(255, 0, 0);
|
||||
}
|
||||
|
||||
void run_out_check() {
|
||||
if (extent < 1) {
|
||||
won = false;
|
||||
nothing = true;
|
||||
popped = true;
|
||||
}
|
||||
}
|
||||
public void hit_check() {
|
||||
PVector pos = new PVector(x, y);
|
||||
PVector mouse = new PVector(window.mouseX, window.mouseY);
|
||||
@ -20,5 +27,6 @@ public class AuraFail extends AuraBubble {
|
||||
pop();
|
||||
won = false;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ public class AuraFight extends Bubble implements Drawable {
|
||||
}
|
||||
|
||||
boolean getRandomBoolean() {
|
||||
return Math.random() > 0.1;
|
||||
return Math.random() > 0.4;
|
||||
//I tried another approaches here, still the same result
|
||||
}
|
||||
|
||||
@ -55,10 +55,15 @@ public class AuraFight extends Bubble implements Drawable {
|
||||
if (my_aura.won) {
|
||||
enemy.damage(5);
|
||||
window.enemyDamage.play();
|
||||
} else {
|
||||
if (my_aura.nothing) {
|
||||
window.noHit.play();
|
||||
my_aura.nothing = false;
|
||||
} else {
|
||||
player.damage(5);
|
||||
window.playerDamage.play();
|
||||
}
|
||||
}
|
||||
if (getRandomBoolean()) {
|
||||
my_aura = new AuraBubble(window);
|
||||
} else {
|
||||
|
||||
@ -61,6 +61,7 @@ public class DeathScreen implements State {
|
||||
System.out.println("mouse pressed");
|
||||
if (mouse.dist(rect) < 40) {
|
||||
window.reset();
|
||||
window.restart.play();
|
||||
System.out.println("reset");
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@ import processing.core.PApplet;
|
||||
*/
|
||||
public class Enemy extends Fightable implements Health, Interactable {
|
||||
int health;
|
||||
int maxHealth = 20;
|
||||
int maxHealth = 100;
|
||||
|
||||
Enemy(Fenster window) {
|
||||
super(window);
|
||||
|
||||
@ -28,6 +28,9 @@ public class Fenster extends PApplet {
|
||||
SoundFile playerDamage;
|
||||
SoundFile healEffect;
|
||||
SoundFile shrinkEffect;
|
||||
SoundFile noHit;
|
||||
SoundFile deathSound;
|
||||
SoundFile restart;
|
||||
|
||||
boolean gametitel = true;
|
||||
|
||||
@ -76,6 +79,9 @@ public class Fenster extends PApplet {
|
||||
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");
|
||||
noHit = new SoundFile(this, "./assets/Bubble 1.wav");
|
||||
deathSound = new SoundFile(this, "./assets/Block Break 1.wav");
|
||||
restart = new SoundFile(this, "./assets/Cancel 1.wav");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -154,6 +160,8 @@ public class Fenster extends PApplet {
|
||||
}
|
||||
|
||||
public void dead() {
|
||||
soundTrack.stop();
|
||||
deathSound.play();
|
||||
gameScreen.isState = false;
|
||||
fightScreen.isState = false;
|
||||
deathScreen.isState = true;
|
||||
@ -161,6 +169,7 @@ public class Fenster extends PApplet {
|
||||
|
||||
public void reset() {
|
||||
classSetup();
|
||||
soundTrack.play();
|
||||
deathScreen.isState = false;
|
||||
startScreen.setup();
|
||||
tiles.settings();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user