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