-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMeteorites.java
More file actions
39 lines (34 loc) · 1.04 KB
/
Meteorites.java
File metadata and controls
39 lines (34 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import java.io.*; //image
import javax.imageio.*; //BufferedImage
/**
* \class Meteorites : classe fille d'ObjetsCelestes gérant les météorites
*/
public class Meteorites extends ObjetsCelestes{
//<!son du contact entre la météorite et le rover
private Audio son;
/**
* \fn Meteorites(FenetreJeu f) : constructeur Meteorites
*
* @param FenetreJeu f : objet désignant la fenêtre principale de jeu
*/
public Meteorites(FenetreJeu f) throws IOException{
super(f);
son = new Audio("audio/meteorites.wav");
image = ImageIO.read(new File("images/meteorite.png"));
}
/**
* \fn void action() : méthode gérant le son lié de la météorite et lançant l'animation de contact entre meteorite et rover
*/
public void action(){
f.toucheMeteorite = true; //le booléen gérant le contact météorite dans la fenêtre jeu devient true
if(f.audioOn){
son.lecture();
}
if(f.pCarbu>15.0){
try{
new MeteoriteAnimation(f); //lancement de l'animation météorite
}catch(IOException Exception){
}
}
}
}