diff --git a/CASE/IMAGE/cinqD.png b/CASE/IMAGE/cinqD.png new file mode 100644 index 0000000..3a42907 Binary files /dev/null and b/CASE/IMAGE/cinqD.png differ diff --git a/CASE/IMAGE/deuxD.png b/CASE/IMAGE/deuxD.png new file mode 100644 index 0000000..a51cb36 Binary files /dev/null and b/CASE/IMAGE/deuxD.png differ diff --git a/CASE/IMAGE/err.png b/CASE/IMAGE/err.png new file mode 100644 index 0000000..eadff1a Binary files /dev/null and b/CASE/IMAGE/err.png differ diff --git a/CASE/IMAGE/huitD.png b/CASE/IMAGE/huitD.png new file mode 100644 index 0000000..bc6dc2a Binary files /dev/null and b/CASE/IMAGE/huitD.png differ diff --git a/CASE/IMAGE/neufD.png b/CASE/IMAGE/neufD.png new file mode 100644 index 0000000..a3aa467 Binary files /dev/null and b/CASE/IMAGE/neufD.png differ diff --git a/CASE/IMAGE/quatreD.png b/CASE/IMAGE/quatreD.png new file mode 100644 index 0000000..89fd693 Binary files /dev/null and b/CASE/IMAGE/quatreD.png differ diff --git a/CASE/IMAGE/sav.png b/CASE/IMAGE/sav.png new file mode 100644 index 0000000..dcda6ae Binary files /dev/null and b/CASE/IMAGE/sav.png differ diff --git a/CASE/IMAGE/septD.png b/CASE/IMAGE/septD.png new file mode 100644 index 0000000..be84204 Binary files /dev/null and b/CASE/IMAGE/septD.png differ diff --git a/CASE/IMAGE/sixD.png b/CASE/IMAGE/sixD.png new file mode 100644 index 0000000..71f8892 Binary files /dev/null and b/CASE/IMAGE/sixD.png differ diff --git a/CASE/IMAGE/troisD.png b/CASE/IMAGE/troisD.png new file mode 100644 index 0000000..3b502a0 Binary files /dev/null and b/CASE/IMAGE/troisD.png differ diff --git a/CASE/IMAGE/unD.png b/CASE/IMAGE/unD.png new file mode 100644 index 0000000..1f5b861 Binary files /dev/null and b/CASE/IMAGE/unD.png differ diff --git a/CASE/IMAGE/zeroD.png b/CASE/IMAGE/zeroD.png new file mode 100644 index 0000000..83a84eb Binary files /dev/null and b/CASE/IMAGE/zeroD.png differ diff --git a/CASE/Makefile b/CASE/Makefile index 1a96e28..705c2d8 100644 --- a/CASE/Makefile +++ b/CASE/Makefile @@ -7,7 +7,9 @@ but: main_ex.class # Chapitre 2 : Variable OFILES= Case.class\ plateau.class\ - observateurCase.class + observateurCase.class\ + paintMenuJeu.class\ + observateurSAV.class CFLAGS= -implicit:none @@ -15,12 +17,18 @@ CFLAGS= -implicit:none Case.class: Case.java javac $(CFLAGS) Case.java -plateau.class : plateau.java Case.class +plateau.class : plateau.java javac $(CFLAGS) plateau.java -observateurCase.class : observateurCase.java Case.class +observateurCase.class : observateurCase.java javac $(CFLAGS) observateurCase.java +paintMenuJeu.class: paintMenuJeu.java + javac $(CFLAGS) paintMenuJeu.java + +observateurSAV.class: observateurSAV.java + javac $(CFLAGS) observateurSAV.java + # Chapitre 4 : Dependances main_ex.class: $(OFILES) main_ex.java diff --git a/CASE/main_ex.class b/CASE/main_ex.class index bedb617..6818521 100644 Binary files a/CASE/main_ex.class and b/CASE/main_ex.class differ diff --git a/CASE/main_ex.java b/CASE/main_ex.java index 1a00484..86351ed 100644 --- a/CASE/main_ex.java +++ b/CASE/main_ex.java @@ -10,13 +10,36 @@ public class main_ex{ public static void main(String[] Args){ // on initialise une fenettre JFrame fenetre = new JFrame("Démineur"); - int ligne=30; - int collonne=80; + int ligne=10; + int collonne=20; + int bombe=30; fenetre.setLocation(0,0); //on choisi une taille arbitraire - fenetre.setSize(1500,800); + //nous utiliserons un gestionnaire GridLayout de dimensions choisi précédament - GridLayout grille = new GridLayout(ligne,collonne); + GridLayout grille = new GridLayout(ligne+1,collonne); + paintMenuJeu[] tabScore= new paintMenuJeu[3]; + for(int i=0; i=100){ + nombre=this.score-100*(this.score/100); + } + nombre=nombre/10; + this.paintNombre(secondPinceau, nombre); + } + if(this.choix==3){ + int nombre=this.score; + if(nombre>=100){ + nombre=this.score-100*(this.score/100); + } + if(nombre>=10){ + nombre=this.score-10*(this.score/10); + } + this.paintNombre(secondPinceau, nombre); + } + if(this.choix==4){ + if(this.survol==true){ + secondPinceau.setColor(new Color(0,255,0)); + secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight()); + } + secondPinceau.drawImage(this.sav, this.getWidth()/6, this.getHeight()/6, this.getWidth()/6*4, this.getHeight()/6*4 ,this); + } + } + private void paintNombre(Graphics secondPinceau, int nombre){ + if(this.score>=0){ + if(nombre==1){ + secondPinceau.drawImage(this.un, this.getWidth()/6, this.getHeight()/6, this.getWidth()/6*4, this.getHeight()/6*4 ,this); + } + if(nombre==2){ + secondPinceau.drawImage(this.deux, this.getWidth()/6, this.getHeight()/6, this.getWidth()/6*4, this.getHeight()/6*4 ,this); + } + if(nombre==3){ + secondPinceau.drawImage(this.trois, this.getWidth()/6, this.getHeight()/6, this.getWidth()/6*4, this.getHeight()/6*4 ,this); + } + if(nombre==4){ + secondPinceau.drawImage(this.quatre, this.getWidth()/6, this.getHeight()/6, this.getWidth()/6*4, this.getHeight()/6*4 ,this); + } + if(nombre==5){ + secondPinceau.drawImage(this.cinq, this.getWidth()/6, this.getHeight()/6, this.getWidth()/6*4, this.getHeight()/6*4 ,this); + } + if(nombre==6){ + secondPinceau.drawImage(this.six, this.getWidth()/6, this.getHeight()/6, this.getWidth()/6*4, this.getHeight()/6*4 ,this); + } + if(nombre==7){ + secondPinceau.drawImage(this.sept, this.getWidth()/6, this.getHeight()/20*5, this.getWidth()/6*4, this.getHeight()/6*4 ,this); + } + if(nombre==8){ + secondPinceau.drawImage(this.huit, this.getWidth()/6, this.getHeight()/6, this.getWidth()/6*4, this.getHeight()/6*4 ,this); + } + if(nombre==9){ + secondPinceau.drawImage(this.neuf, this.getWidth()/6, this.getHeight()/6, this.getWidth()/6*4, this.getHeight()/6*4 ,this); + } + if(nombre==0){ + secondPinceau.drawImage(this.zero, this.getWidth()/6, this.getHeight()/6, this.getWidth()/6*4, this.getHeight()/6*4 ,this); + } + }else{ + secondPinceau.drawImage(this.err, this.getWidth()/20*5, this.getHeight()/20*5, this.getWidth()/6*4, this.getHeight()/6*4 ,this); + } + + } +} \ No newline at end of file