Skip to content
Snippets Groups Projects
Commit ba4a63a1 authored by bruno's avatar bruno
Browse files

key2

parent f651d446
Branches
No related tags found
1 merge request!1Key
......@@ -118,12 +118,12 @@ public class Character extends Entity{
}
public void keyGestion() {
for (Coffre obs : Jeu.getCoffreTable()){
if (collision(this.getHitBox(), obs.getHitbox())){
if (obs.key ==true) {
for (Coffre cof : Jeu.getCoffreTable()){
if (collision(this.getHitBox(), cof.getHitbox())){
if (cof.key ==true) {
this.key += 1;
obs.key = false;
System.out.print(this.key);
cof.key = false;
System.out.print("Tu as trouvé une clée!");
}
}
}
......
......@@ -43,6 +43,7 @@ public class Painter implements GamePainter{
drawSol(crayon);
drawObstacleBis(crayon,test,"plateforme.png");
drawLifePoints(crayon);
drawKey(crayon);
drawMonsters(crayon);
}
......@@ -55,6 +56,12 @@ public class Painter implements GamePainter{
}
private void drawKey(Graphics2D crayon){
if(gameCharacter.key==0) {
crayon.fillRect(-10,20,-20,30);
}
}
private void drawLifePoints(Graphics2D crayon){
String fn = "Frames_perso";
URL url = Jeu.class.getClassLoader().getResource(fn);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment