jeufinal
@ -1,8 +1,8 @@
|
||||
public class Arme extends CaseBonus{
|
||||
public int value;
|
||||
|
||||
public Arme(int v, int x, int y){
|
||||
super(x, y, "arme");
|
||||
public Arme(int v, int x, int y, String t){
|
||||
super(x, y, t);
|
||||
this.value = v;
|
||||
}
|
||||
|
||||
|
@ -49,11 +49,15 @@ public class Case {
|
||||
}
|
||||
//Méthode pour obtenir l'arme de la case
|
||||
public Arme getArme(){
|
||||
return new Arme(0, 0, 0);
|
||||
return new Arme(0, 0, 0, "arme");
|
||||
}
|
||||
//Méthode pour définir l'arme de la case
|
||||
public void setArme(int atk){
|
||||
public void setArme(int atk, String type){
|
||||
|
||||
}
|
||||
//Méthode pour obtenir le type de la case
|
||||
public String getType(){
|
||||
return this.type;
|
||||
}
|
||||
//Méthode pour vérifier si on rencontre une case
|
||||
public boolean rencontrer(Case c){
|
||||
@ -71,8 +75,25 @@ public class Case {
|
||||
if(aleatoire < 0){
|
||||
aleatoire = -aleatoire;
|
||||
}
|
||||
|
||||
return new Monstre(aleatoire % 40 + 1, x, y);
|
||||
if (aleatoire % 100 < 10){
|
||||
aleatoire = rand.nextInt();
|
||||
if(aleatoire < 0){
|
||||
aleatoire = -aleatoire;
|
||||
}
|
||||
return new Monstrefeu(aleatoire % 30 + 51, x, y);
|
||||
} else if (aleatoire % 100 > 90){
|
||||
aleatoire = rand.nextInt();
|
||||
if(aleatoire < 0){
|
||||
aleatoire = -aleatoire;
|
||||
}
|
||||
return new Monstreglace(aleatoire % 30 + 51, x, y);
|
||||
} else {
|
||||
aleatoire = rand.nextInt();
|
||||
if(aleatoire < 0){
|
||||
aleatoire = -aleatoire;
|
||||
}
|
||||
return new Monstre(aleatoire % 30 + 21, x, y);
|
||||
}
|
||||
} else {
|
||||
return new CaseBonus(x, y, "temp").newRandomCaseBonus(x, y);
|
||||
}
|
||||
|
@ -20,21 +20,38 @@ public class CaseBonus extends Case {
|
||||
if(aleatoire < 0){
|
||||
aleatoire = -aleatoire;
|
||||
}
|
||||
return new Potion(aleatoire % 40 + 1, x, y);
|
||||
} else {
|
||||
if (aleatoire % 100 > 64){
|
||||
return new Potion(aleatoire % 25 + 16, x, y);
|
||||
} else if (aleatoire % 100 > 64){
|
||||
aleatoire = rand.nextInt();
|
||||
if(aleatoire < 0){
|
||||
aleatoire = -aleatoire;
|
||||
}
|
||||
return new Arme(aleatoire % 50 + 1, x, y);
|
||||
if (aleatoire % 100 < 12){
|
||||
aleatoire = rand.nextInt();
|
||||
if(aleatoire < 0){
|
||||
aleatoire = -aleatoire;
|
||||
}
|
||||
return new Arme(aleatoire % 40 + 61, x, y, "armefeu");
|
||||
} else if (aleatoire % 100 > 88){
|
||||
aleatoire = rand.nextInt();
|
||||
if(aleatoire < 0){
|
||||
aleatoire = -aleatoire;
|
||||
}
|
||||
return new Arme(aleatoire % 40 + 61, x, y, "armeglace");
|
||||
} else {
|
||||
aleatoire = rand.nextInt();
|
||||
if(aleatoire < 0){
|
||||
aleatoire = -aleatoire;
|
||||
}
|
||||
return new Or(aleatoire % 100 + 1, x, y);
|
||||
return new Arme(aleatoire % 40 + 11, x, y, "arme");
|
||||
}
|
||||
} else {
|
||||
aleatoire = rand.nextInt();
|
||||
if(aleatoire < 0){
|
||||
aleatoire = -aleatoire;
|
||||
}
|
||||
return new Or(aleatoire % 80 + 21, x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
7309
SAe2.1/commentente/SAé/DiagrammeSae.mdj
Normal file
@ -9,8 +9,8 @@ public class DonjonInfini{
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
Controleur fenetre = new Controleur();
|
||||
fenetre.setSize(600, 680);
|
||||
Precontroleur fenetre = new Precontroleur();
|
||||
fenetre.setSize(1000, 1000);
|
||||
fenetre.setLocation(0, 0);
|
||||
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
fenetre.setVisible(true);
|
||||
|
@ -3,10 +3,10 @@ public class Heros extends Case {
|
||||
private Arme arme;
|
||||
private int pv;
|
||||
|
||||
public Heros(int x, int y) {
|
||||
super(x, y, "hero");
|
||||
this.pv = 250;
|
||||
this.arme = new Arme(0, x, y);
|
||||
public Heros(int x, int y, String t, int pdv) {
|
||||
super(x, y, t);
|
||||
this.pv = pdv;
|
||||
this.arme = new Arme(0, x, y, "arme");
|
||||
}
|
||||
|
||||
public String getLabelPv() {
|
||||
@ -25,8 +25,9 @@ public class Heros extends Case {
|
||||
return this.arme;
|
||||
}
|
||||
|
||||
public void setArme(int atk){
|
||||
public void setArme(int atk, String type){
|
||||
this.arme.value=atk;
|
||||
this.arme.type=type;
|
||||
}
|
||||
|
||||
public boolean rencontrer(Case c) {
|
||||
@ -36,7 +37,16 @@ public class Heros extends Case {
|
||||
if (c.type.equals("arme")) {
|
||||
return true;
|
||||
}
|
||||
if (c.type.equals("armefeu")) {
|
||||
return true;
|
||||
}
|
||||
if (c.type.equals("armeglace")) {
|
||||
return true;
|
||||
}
|
||||
if (c.type.equals("potion")) {
|
||||
if (this.type.equals("mage")){
|
||||
this.pv += c.getValue();
|
||||
}
|
||||
this.pv += c.getValue();
|
||||
return true;
|
||||
}
|
||||
@ -47,6 +57,20 @@ public class Heros extends Case {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (c.type.equals("monstrefeu")) {
|
||||
if (this.arme.value > 0) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (c.type.equals("monstreglace")) {
|
||||
if (this.arme.value > 0) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
BIN
SAe2.1/commentente/SAé/Imag.class
Normal file
32
SAe2.1/commentente/SAé/Imag.java
Normal file
@ -0,0 +1,32 @@
|
||||
import java.awt.*;
|
||||
import javax.swing.*;
|
||||
import java.awt.event.*;
|
||||
import java.lang.*;
|
||||
import javax.imageio.*;
|
||||
import java.io.*;
|
||||
|
||||
public class Imag extends JComponent{
|
||||
private Image image;
|
||||
|
||||
public Imag(int width, int height, String path) throws IOException {
|
||||
try{
|
||||
image = ImageIO.read(new File(path));
|
||||
}catch(IOException e){
|
||||
System.out.println("Erreur d'ouverture");
|
||||
}
|
||||
setPreferredSize(new Dimension(width, height));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
protected void paintComponent(Graphics pinceau) {
|
||||
// obligatoire : on cree un nouveau pinceau pour pouvoir le modifier plus tard
|
||||
Graphics pinceau2 = pinceau.create();
|
||||
if (this.isOpaque()) {
|
||||
// obligatoire : on repeint toute la surface avec la couleur de fond
|
||||
pinceau2.setColor(this.getBackground());
|
||||
pinceau2.fillRect(0, 0, this.getWidth(), this.getHeight());
|
||||
}
|
||||
pinceau2.drawImage(this.image, 0, 0, 180, 180, this);
|
||||
}
|
||||
}
|
BIN
SAe2.1/commentente/SAé/Monstrefeu.class
Normal file
23
SAe2.1/commentente/SAé/Monstrefeu.java
Normal file
@ -0,0 +1,23 @@
|
||||
|
||||
public class Monstrefeu extends Case{ //Déclaration de la classe Monstre
|
||||
|
||||
private int pv; //Variable pour stocker les points de vie du monstre
|
||||
|
||||
public Monstrefeu(int pdv, int x, int y){ //Constructeur de la classe Monstre
|
||||
super(x, y, "monstrefeu"); //Appel du constructeur de la classe parente Case en passant les coordonnées x et y, ainsi que le type "monstre"
|
||||
this.pv = pdv; //Initialisation de l'attribut pv avec la valeur pdv (= point de vie)
|
||||
}
|
||||
|
||||
public String getLabelPv(){ //Méthode pour obtenir le label des points de vie du monstre
|
||||
return (""+this.pv); //Retourne les points de vie du monstre convertis en chaîne de caractères
|
||||
}
|
||||
|
||||
public int getPv(){ //Méthode pour obtenir les points de vie du monstre
|
||||
return this.pv;
|
||||
}
|
||||
|
||||
public void setPv(int pdv){ //Méthode pour définir les points de vie du monstre
|
||||
this.pv=pdv;
|
||||
}
|
||||
|
||||
}
|
BIN
SAe2.1/commentente/SAé/Monstreglace.class
Normal file
23
SAe2.1/commentente/SAé/Monstreglace.java
Normal file
@ -0,0 +1,23 @@
|
||||
|
||||
public class Monstreglace extends Case{ //Déclaration de la classe Monstre
|
||||
|
||||
private int pv; //Variable pour stocker les points de vie du monstre
|
||||
|
||||
public Monstreglace(int pdv, int x, int y){ //Constructeur de la classe Monstre
|
||||
super(x, y, "monstreglace"); //Appel du constructeur de la classe parente Case en passant les coordonnées x et y, ainsi que le type "monstre"
|
||||
this.pv = pdv; //Initialisation de l'attribut pv avec la valeur pdv (= point de vie)
|
||||
}
|
||||
|
||||
public String getLabelPv(){ //Méthode pour obtenir le label des points de vie du monstre
|
||||
return (""+this.pv); //Retourne les points de vie du monstre convertis en chaîne de caractères
|
||||
}
|
||||
|
||||
public int getPv(){ //Méthode pour obtenir les points de vie du monstre
|
||||
return this.pv;
|
||||
}
|
||||
|
||||
public void setPv(int pdv){ //Méthode pour définir les points de vie du monstre
|
||||
this.pv=pdv;
|
||||
}
|
||||
|
||||
}
|
BIN
SAe2.1/commentente/SAé/Precontroleur.class
Normal file
90
SAe2.1/commentente/SAé/Precontroleur.java
Normal file
@ -0,0 +1,90 @@
|
||||
import java.awt.*;
|
||||
import javax.swing.*;
|
||||
import java.awt.event.*;
|
||||
import java.lang.*;
|
||||
import javax.imageio.*;
|
||||
import java.io.*;
|
||||
|
||||
public class Precontroleur extends JFrame implements ActionListener{
|
||||
|
||||
public Precontroleur() {
|
||||
super();
|
||||
JButton berserker = new JButton("BERSERKER");
|
||||
JButton hero = new JButton("HERO");
|
||||
JButton mage = new JButton("MAGE");
|
||||
JButton tank = new JButton("TANK");
|
||||
JLabel infoberserker = new JLabel("- dégâts x2 mais 150pv de départ");
|
||||
JLabel infohero = new JLabel("- pas de bonus, 250pv de départ");
|
||||
JLabel infomage = new JLabel("- pv rendu par potion x2 mais 100pv de départ");
|
||||
JLabel infotank = new JLabel("- 400pv de départ mais dégâts x0.8");
|
||||
berserker.setLayout(new GridLayout(2,1));
|
||||
hero.setLayout(new GridLayout(2,1));
|
||||
mage.setLayout(new GridLayout(2,1));
|
||||
tank.setLayout(new GridLayout(2,1));
|
||||
this.setLayout(new GridLayout(2,2));
|
||||
this.add(berserker);
|
||||
this.add(hero);
|
||||
this.add(mage);
|
||||
this.add(tank);
|
||||
try{
|
||||
berserker.add(new Imag(500, 500, "./images/berserker.png"));
|
||||
tank.add(new Imag(500, 500, "./images/tank.png"));
|
||||
mage.add(new Imag(500, 500, "./images/mage.png"));
|
||||
hero.add(new Imag(500, 500, "./images/hero.png"));
|
||||
} catch(IOException e){
|
||||
System.out.println("Erreur d'ouverture");
|
||||
}
|
||||
berserker.add(infoberserker);
|
||||
hero.add(infohero);
|
||||
mage.add(infomage);
|
||||
tank.add(infotank);
|
||||
berserker.addActionListener(this);
|
||||
hero.addActionListener(this);
|
||||
mage.addActionListener(this);
|
||||
tank.addActionListener(this);
|
||||
berserker.setActionCommand("berserker");
|
||||
hero.setActionCommand("hero");
|
||||
mage.setActionCommand("mage");
|
||||
tank.setActionCommand("tank");
|
||||
}
|
||||
|
||||
public void actionPerformed(ActionEvent evenement){
|
||||
String commande = new String();
|
||||
commande="berserker";
|
||||
if(true==commande.equals(evenement.getActionCommand())){
|
||||
Controleur fenetre = new Controleur("berserker",150);
|
||||
fenetre.setSize(1000, 1000);
|
||||
fenetre.setLocation(0, 0);
|
||||
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
fenetre.setVisible(true);
|
||||
this.dispose();
|
||||
}
|
||||
commande="hero";
|
||||
if(true==commande.equals(evenement.getActionCommand())){
|
||||
Controleur fenetre = new Controleur("hero",250);
|
||||
fenetre.setSize(1000, 1000);
|
||||
fenetre.setLocation(0, 0);
|
||||
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
fenetre.setVisible(true);
|
||||
this.dispose();
|
||||
}
|
||||
commande="mage";
|
||||
if(true==commande.equals(evenement.getActionCommand())){
|
||||
Controleur fenetre = new Controleur("mage",100);
|
||||
fenetre.setSize(1000, 1000);
|
||||
fenetre.setLocation(0, 0);
|
||||
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
fenetre.setVisible(true);
|
||||
this.dispose();
|
||||
}
|
||||
commande="tank";
|
||||
if(true==commande.equals(evenement.getActionCommand())){
|
||||
Controleur fenetre = new Controleur("tank",400);
|
||||
fenetre.setSize(1000, 1000);
|
||||
fenetre.setLocation(0, 0);
|
||||
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
fenetre.setVisible(true);
|
||||
this.dispose();
|
||||
}
|
||||
}
|
||||
}
|
BIN
SAe2.1/commentente/SAé/Saefinal2.1.tar
Normal file
@ -1,5 +1,7 @@
|
||||
import java.awt.*;
|
||||
import javax.swing.*;
|
||||
import javax.imageio.*;
|
||||
import java.io.*;
|
||||
|
||||
public class VueCase extends JPanel {
|
||||
|
||||
@ -25,6 +27,38 @@ public class VueCase extends JPanel {
|
||||
p2.fillRect(0, 0, this.getWidth(), this.getHeight());
|
||||
p2.setColor(Color.BLACK);
|
||||
p2.drawString("Monstre, Pv restant :" + caseN.getLabelPv(), (this.getWidth() / 2) - 50, (this.getHeight() / 2) - 10);
|
||||
try{
|
||||
p2.drawImage(ImageIO.read(new File("./images/monstre.png")),0 ,0, 50, 50, this);
|
||||
|
||||
} catch(IOException e){
|
||||
System.out.println("Erreur d'ouverture");
|
||||
}
|
||||
}
|
||||
if (this.caseN.type.equals("monstreglace")) {
|
||||
//Dessine un rectangle rouge pour représenter un monstre
|
||||
p2.setColor(Color.RED);
|
||||
p2.fillRect(0, 0, this.getWidth(), this.getHeight());
|
||||
p2.setColor(Color.BLACK);
|
||||
p2.drawString("Monstre de glace, Pv restant :" + caseN.getLabelPv(), (this.getWidth() / 2) - 90, (this.getHeight() / 2) - 10);
|
||||
try{
|
||||
p2.drawImage(ImageIO.read(new File("./images/monstreglace.png")),0 ,0, 50, 50, this);
|
||||
|
||||
} catch(IOException e){
|
||||
System.out.println("Erreur d'ouverture");
|
||||
}
|
||||
}
|
||||
if (this.caseN.type.equals("monstrefeu")) {
|
||||
//Dessine un rectangle rouge pour représenter un monstre
|
||||
p2.setColor(Color.RED);
|
||||
p2.fillRect(0, 0, this.getWidth(), this.getHeight());
|
||||
p2.setColor(Color.BLACK);
|
||||
p2.drawString("Monstre de feu, Pv restant :" + caseN.getLabelPv(), (this.getWidth() / 2) - 90, (this.getHeight() / 2) - 10);
|
||||
try{
|
||||
p2.drawImage(ImageIO.read(new File("./images/monstrefeu.png")),0 ,0, 50, 50, this);
|
||||
|
||||
} catch(IOException e){
|
||||
System.out.println("Erreur d'ouverture");
|
||||
}
|
||||
}
|
||||
if (this.caseN.type.equals("or")) {
|
||||
//Dessine un rectangle jaune pour représenter de l'or
|
||||
@ -32,13 +66,68 @@ public class VueCase extends JPanel {
|
||||
p2.fillRect(0, 0, this.getWidth(), this.getHeight());
|
||||
p2.setColor(Color.BLACK);
|
||||
p2.drawString("Or, Points obtenu :" + caseN.getLabel(), (this.getWidth() / 2) - 50, (this.getHeight() / 2) - 10);
|
||||
try{
|
||||
p2.drawImage(ImageIO.read(new File("./images/or.png")),0 ,0, 50, 50, this);
|
||||
|
||||
} catch(IOException e){
|
||||
System.out.println("Erreur d'ouverture");
|
||||
}
|
||||
}
|
||||
if (this.caseN.type.equals("hero")) {
|
||||
//Dessine un rectangle cyan pour représenter le héro
|
||||
p2.setColor(Color.CYAN);
|
||||
p2.fillRect(0, 0, this.getWidth(), this.getHeight());
|
||||
p2.setColor(Color.BLACK);
|
||||
p2.drawString("Hero, Pv :" + caseN.getLabelPv(), (this.getWidth() / 2) - 30, (this.getHeight() / 2) - 10);
|
||||
p2.drawString("Hero, Pv :" + caseN.getLabelPv(), (this.getWidth() / 2) - 45, (this.getHeight() / 2) - 10);
|
||||
p2.drawString("Arme :"+ caseN.getArme().getValue()+" Type :"+caseN.getArme().getType(), (this.getWidth() / 2) - 55, (this.getHeight() / 2) + 10);
|
||||
try{
|
||||
p2.drawImage(ImageIO.read(new File("./images/truehero.png")),0 ,0, 50, 50, this);
|
||||
|
||||
} catch(IOException e){
|
||||
System.out.println("Erreur d'ouverture");
|
||||
}
|
||||
}
|
||||
if (this.caseN.type.equals("berserker")) {
|
||||
//Dessine un rectangle cyan pour représenter le héro
|
||||
p2.setColor(Color.CYAN);
|
||||
p2.fillRect(0, 0, this.getWidth(), this.getHeight());
|
||||
p2.setColor(Color.BLACK);
|
||||
p2.drawString("Berserker, Pv :" + caseN.getLabelPv(), (this.getWidth() / 2) - 45, (this.getHeight() / 2) - 10);
|
||||
p2.drawString("Arme :"+ caseN.getArme().getValue()+" Type :"+caseN.getArme().getType(), (this.getWidth() / 2) - 55, (this.getHeight() / 2) + 10);
|
||||
try{
|
||||
p2.drawImage(ImageIO.read(new File("./images/truehero.png")),0 ,0, 50, 50, this);
|
||||
|
||||
} catch(IOException e){
|
||||
System.out.println("Erreur d'ouverture");
|
||||
}
|
||||
}
|
||||
if (this.caseN.type.equals("mage")) {
|
||||
//Dessine un rectangle cyan pour représenter le héro
|
||||
p2.setColor(Color.CYAN);
|
||||
p2.fillRect(0, 0, this.getWidth(), this.getHeight());
|
||||
p2.setColor(Color.BLACK);
|
||||
p2.drawString("Mage, Pv :" + caseN.getLabelPv(), (this.getWidth() / 2) - 45, (this.getHeight() / 2) - 10);
|
||||
p2.drawString("Arme :"+ caseN.getArme().getValue()+" Type :"+caseN.getArme().getType(), (this.getWidth() / 2) - 55, (this.getHeight() / 2) + 10);
|
||||
try{
|
||||
p2.drawImage(ImageIO.read(new File("./images/truehero.png")),0 ,0, 50, 50, this);
|
||||
|
||||
} catch(IOException e){
|
||||
System.out.println("Erreur d'ouverture");
|
||||
}
|
||||
}
|
||||
if (this.caseN.type.equals("tank")) {
|
||||
//Dessine un rectangle cyan pour représenter le héro
|
||||
p2.setColor(Color.CYAN);
|
||||
p2.fillRect(0, 0, this.getWidth(), this.getHeight());
|
||||
p2.setColor(Color.BLACK);
|
||||
p2.drawString("Tank, Pv :" + caseN.getLabelPv(), (this.getWidth() / 2) - 45, (this.getHeight() / 2) - 10);
|
||||
p2.drawString("Arme :"+ caseN.getArme().getValue()+" Type :"+caseN.getArme().getType(), (this.getWidth() / 2) - 55, (this.getHeight() / 2) + 10);
|
||||
try{
|
||||
p2.drawImage(ImageIO.read(new File("./images/truehero.png")),0 ,0, 50, 50, this);
|
||||
|
||||
} catch(IOException e){
|
||||
System.out.println("Erreur d'ouverture");
|
||||
}
|
||||
}
|
||||
if (this.caseN.type.equals("potion")) {
|
||||
//Dessine un rectangle vert pour représenter une potion
|
||||
@ -46,6 +135,12 @@ public class VueCase extends JPanel {
|
||||
p2.fillRect(0, 0, this.getWidth(), this.getHeight());
|
||||
p2.setColor(Color.BLACK);
|
||||
p2.drawString("Potion, Pv rendu: " + caseN.getLabel(), (this.getWidth() / 2) - 60, (this.getHeight() / 2) - 10);
|
||||
try{
|
||||
p2.drawImage(ImageIO.read(new File("./images/potion.png")),0 ,0, 50, 50, this);
|
||||
|
||||
} catch(IOException e){
|
||||
System.out.println("Erreur d'ouverture");
|
||||
}
|
||||
}
|
||||
if (this.caseN.type.equals("arme")) {
|
||||
//Dessine un rectangle bleu pour représenter une arme
|
||||
@ -53,6 +148,38 @@ public class VueCase extends JPanel {
|
||||
p2.fillRect(0, 0, this.getWidth(), this.getHeight());
|
||||
p2.setColor(Color.BLACK);
|
||||
p2.drawString("Arme, Atk: " + caseN.getLabel(), (this.getWidth() / 2) - 40, (this.getHeight() / 2) - 10);
|
||||
try{
|
||||
p2.drawImage(ImageIO.read(new File("./images/arme.png")),0 ,0, 50, 50, this);
|
||||
|
||||
} catch(IOException e){
|
||||
System.out.println("Erreur d'ouverture");
|
||||
}
|
||||
}
|
||||
if (this.caseN.type.equals("armeglace")) {
|
||||
//Dessine un rectangle bleu pour représenter une arme
|
||||
p2.setColor(Color.BLUE);
|
||||
p2.fillRect(0, 0, this.getWidth(), this.getHeight());
|
||||
p2.setColor(Color.BLACK);
|
||||
p2.drawString("Arme de glace, Atk: " + caseN.getLabel(), (this.getWidth() / 2) - 40, (this.getHeight() / 2) - 10);
|
||||
try{
|
||||
p2.drawImage(ImageIO.read(new File("./images/armeglace.png")),0 ,0, 50, 50, this);
|
||||
|
||||
} catch(IOException e){
|
||||
System.out.println("Erreur d'ouverture");
|
||||
}
|
||||
}
|
||||
if (this.caseN.type.equals("armefeu")) {
|
||||
//Dessine un rectangle bleu pour représenter une arme
|
||||
p2.setColor(Color.BLUE);
|
||||
p2.fillRect(0, 0, this.getWidth(), this.getHeight());
|
||||
p2.setColor(Color.BLACK);
|
||||
p2.drawString("Arme de feu, Atk: " + caseN.getLabel(), (this.getWidth() / 2) - 40, (this.getHeight() / 2) - 10);
|
||||
try{
|
||||
p2.drawImage(ImageIO.read(new File("./images/armefeu.png")),0 ,0, 50, 50, this);
|
||||
|
||||
} catch(IOException e){
|
||||
System.out.println("Erreur d'ouverture");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ public class VuePlateau extends JPanel{
|
||||
p2.fillRect(0, 0, this.getWidth(), this.getHeight());
|
||||
}
|
||||
p2.setColor(Color.BLACK);
|
||||
p2.drawString("Points :" + this.vuePoints, 100, 100);
|
||||
p2.drawString("POINTS :" + this.vuePoints, 120, 120);
|
||||
}
|
||||
|
||||
|
||||
|
BIN
SAe2.1/commentente/SAé/images/arme.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
SAe2.1/commentente/SAé/images/armefeu.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
SAe2.1/commentente/SAé/images/armeglace.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
SAe2.1/commentente/SAé/images/berserker.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
SAe2.1/commentente/SAé/images/hero.png
Normal file
After Width: | Height: | Size: 937 B |
BIN
SAe2.1/commentente/SAé/images/mage.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
SAe2.1/commentente/SAé/images/monstre.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
SAe2.1/commentente/SAé/images/monstrefeu.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
SAe2.1/commentente/SAé/images/monstreglace.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
SAe2.1/commentente/SAé/images/or.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
SAe2.1/commentente/SAé/images/potion.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
SAe2.1/commentente/SAé/images/tank.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
SAe2.1/commentente/SAé/images/truehero.png
Normal file
After Width: | Height: | Size: 1.1 KiB |