systeme points/écran game over
This commit is contained in:
@@ -18,7 +18,7 @@ public class ZoneDessin extends JPanel {
|
||||
|
||||
protected boolean estArrete = false;
|
||||
|
||||
public ZoneDessin(){
|
||||
public ZoneDessin() {
|
||||
setLayout(new BorderLayout());
|
||||
setPreferredSize(new Dimension(800, 600));
|
||||
setBackground(new Color(0, 73, 220));
|
||||
@@ -28,20 +28,20 @@ public class ZoneDessin extends JPanel {
|
||||
listeObjets.add(unObjet);
|
||||
}
|
||||
|
||||
public void arreter(){
|
||||
public void arreter() {
|
||||
estArrete = true;
|
||||
}
|
||||
public void demarrer(){
|
||||
|
||||
public void demarrer() {
|
||||
estArrete = false;
|
||||
}
|
||||
|
||||
|
||||
public void traiterBoucleAnimation(){
|
||||
if (estArrete==true) {
|
||||
public void traiterBoucleAnimation() {
|
||||
if (estArrete == true) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (ObjetGraphique obj : listeObjets){
|
||||
for (ObjetGraphique obj : listeObjets) {
|
||||
obj.Animer();
|
||||
}
|
||||
|
||||
@@ -52,10 +52,14 @@ public class ZoneDessin extends JPanel {
|
||||
super.paintComponent(g);
|
||||
|
||||
Graphics2D g2D = (Graphics2D) g;
|
||||
g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
|
||||
g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
||||
|
||||
for (ObjetGraphique obj : listeObjets){
|
||||
for (ObjetGraphique obj : listeObjets) {
|
||||
obj.Afficher(g);
|
||||
}
|
||||
}
|
||||
|
||||
public void viderObjets() {
|
||||
listeObjets.clear();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user