Example #1
0
  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;
  }
Example #2
0
  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;
  }
Example #3
0
  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);
      }
    }
  }
Example #4
0
  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;
  }
Example #5
0
  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());
      }
    }
  }
Example #6
0
 public Object_c getObjectsTab(int x, int y) {
   return map_m.getObjectsTab(x, y);
 }
Example #7
0
 public Object_c[][] getTabMap() {
   return map_m.getTabMap();
 }
Example #8
0
  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];
  }
Example #9
0
 public void removeBombe(Obj_Bombe_c obj_bombe_c) {
   obj_bombe_c.getOwner().removeBombeInList(obj_bombe_c);
   map_m.removeObjets(obj_bombe_c);
 }
Example #10
0
  public void removeBonus(Obj_Bonus_c obj_bonus_c) {

    if (obj_bonus_c == null) return;

    map_m.removeObjets(obj_bonus_c);
  }
Example #11
0
 public void removeFeu(Obj_Feu_c obj_feu_c) {
   map_m.removeObjets(obj_feu_c);
 }
Example #12
0
 public void removeObjets(Object_c obj) {
   map_m.removeObjets(obj);
 }
Example #13
0
  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);
  }