Пример #1
0
  /**
   * get xp and gold from killing characters
   *
   * @param Charac collision characters
   */
  public void KillXP(GameCharacter Charac) {
    // When the character dies
    if (Charac.ISDEAD && Charac.COLL_LISTENER) {

      Charac.COLL_LISTENER = false;
      audDEATH.playAudio("death.wav");

      // Remove collision listener
      for (int j = 0; j < FIREBALL.length; j++) {
        FIREBALL[j].removeCollChar(Charac);
      }
      for (int j = 0; j < SHOCK.length; j++) {
        SHOCK[j].removeCollChar(Charac);
      }
      for (int j = 0; j < DARKNESS.length; j++) {
        DARKNESS[j].removeCollChar(Charac);
      }
      for (int j = 0; j < LIFE_DRAIN.length; j++) {
        LIFE_DRAIN[j].removeCollChar(Charac);
      }

      // Add Xp
      STATS.IncreaseXP(10 * Charac.STATS.LEVEL);
      // Add Gold
      this.GOLD += Charac.GOLD;
    }
  }
Пример #2
0
 /**
  * Adds or updates a entity of the map
  *
  * @param character
  */
 public void addEntity(GameCharacter character) {
   if (mapCharacterEntities.containsKey(character.getEntityID())) {
     mapCharacterEntities.remove(character.getEntityID());
   }
   mapCharacterEntities.put(character.getEntityID(), character);
 }