public Obj_Bonus_c addBonus(float x, float y) { Obj_Bonus_c bonus = new Obj_Bonus_c(); map_m.addObjets(bonus, x, y); return bonus; }
public Obj_Bombe_c addBombe(Obj_Player_c obj_player_c, float x, float y) { Obj_Bombe_c bombe = new Obj_Bombe_c(obj_player_c, this); map_m.addObjets(bombe, x, y); return bombe; }
public void createObjectsMap() { // Ajout des objets for (int i = 0; i < Game_c.TAILLE_MAP; i++) { for (int j = 0; j < Game_c.TAILLE_MAP; j++) { map_m.videTab(i, j); if (j == 0 || i == 0 || i == Game_c.TAILLE_MAP - 1 || j == Game_c.TAILLE_MAP - 1) map_m.addObjets(new Obj_Bloc_indestructible_c(), i * 32.f, j * 32.f); else if (i % 2 == 0 && j % 2 == 0) map_m.addObjets(new Obj_Bloc_indestructible_c(), i * 32.f, j * 32.f); else if (blocIsPlacable(i, j)) map_m.addObjets(new Obj_Bloc_destructible_c(), i * 32.f, j * 32.f); } } }
public Obj_Feu_c addFeu(float x, float y) { Obj_Feu_c feu = new Obj_Feu_c(this); map_m.addObjets(feu, x, y); game_c.checkCollisionExplosion(feu); return feu; }
public void updateObjectsMap(Menu_v menu_v) { Object_c obj; for (int i = 0; i < Game_c.TAILLE_MAP; i++) { for (int j = 0; j < Game_c.TAILLE_MAP; j++) { if (((obj = map_m.getObjectsTab(i, j)) == null)) continue; if (obj.getTypeObj() == Object_m.Type.BONUS && ((Obj_Bonus_c) obj).isActived()) continue; menu_v.draw(obj.getSprite()); } } }
public Object_c getObjectsTab(int x, int y) { return map_m.getObjectsTab(x, y); }
public Object_c[][] getTabMap() { return map_m.getTabMap(); }
public Object_c getObjectByPosition(float x, float y) { int caseX = Math.round(x / 32.f); int caseY = Math.round(y / 32.f); return map_m.getTabMap()[caseX][caseY]; }
public void removeBombe(Obj_Bombe_c obj_bombe_c) { obj_bombe_c.getOwner().removeBombeInList(obj_bombe_c); map_m.removeObjets(obj_bombe_c); }
public void removeBonus(Obj_Bonus_c obj_bonus_c) { if (obj_bonus_c == null) return; map_m.removeObjets(obj_bonus_c); }
public void removeFeu(Obj_Feu_c obj_feu_c) { map_m.removeObjets(obj_feu_c); }
public void removeObjets(Object_c obj) { map_m.removeObjets(obj); }
public Object_c getObjectsTab(float x, float y) { int posX = Math.round((x - Game_c.posXTerrain) / 32.0f); int posY = Math.round(y / 32.0f); return map_m.getObjectsTab(posX, posY); }