Examples of GameContext


Examples of de.creepsmash.client.game.GameContext

  }

  @Override
  public synchronized void actionPerformed(ActionEvent e) {
    if (gamepanel.getCreepPanel().getContext() != null) {
      GameContext context = gamepanel.getCreepPanel().getContext();
      if (!context.isDead()) {
        if (((e.getModifiers() & ActionEvent.SHIFT_MASK) > 0) && context.readyForNewWave()) {
          context.sendCreepsWave(context, gamepanel, type);
        } else if (context.readyForNewCreep() && context.readyForNewWave()) {
          context.sendCreep(context, gamepanel, type);
        }
      }
    }
  }
View Full Code Here

Examples of de.creepsmash.client.game.GameContext

        path + name + ".png"));
  }

  @Override
  public void actionPerformed(ActionEvent e) {
    GameContext context = gamepanel.getContext();
    if (context.isDead()) {
      context.setSelectedTower(null);
      return;
    }
    context.setNextTower(type);
    context.getGameBoard().deSelectTowers();
    context.setSelectedTower(null);
    gamepanel.getSelectTowerInfoPanel().setVisible(false);
    gamepanel.setLastTowerInfoPanel(gamepanel.getBuildTowerInfoPanel());
    updateTowerInfo();
  }
View Full Code Here

Examples of de.creepsmash.client.game.GameContext

        this.panel = panel;
      }
     
      public void actionPerformed(ActionEvent event) {
       
        GameContext conText = this.panel.getContext();
        if (!conText.isDead() && conText.readyForNewCreep())
          conText.sendCreep(conText, panel, type);
       
      }
     
    }
    class SendWaveAction extends SendAction {
     
      public SendWaveAction( IConstants.Creeps type, GamePanel panel ) {
        super(type, panel);
      }
     
      public void actionPerformed(ActionEvent event) {
       
        GameContext conText = this.panel.getContext();
        if (!conText.isDead() && conText.readyForNewWave())
          conText.sendCreepsWave(conText, panel, type);
      }
     
    }
   
    class BuildAction extends AbstractAction {
     
      protected IConstants.Towers type;
      protected GamePanel panel;
     
      public BuildAction( IConstants.Towers type, GamePanel panel ) {
        this.type = type;
        this.panel = panel;
      }
     
      public void actionPerformed(ActionEvent event) {
        GameContext conText = this.panel.getContext();
        if (!conText.isDead())
          conText.buyTower(type);   
      }
     
    }
   
    //Send Creeps
View Full Code Here

Examples of de.creepsmash.client.game.GameContext

        this.panel = panel;
      }
     
      public void actionPerformed(ActionEvent event) {
       
        GameContext conText = this.panel.getContext();
        if (!conText.isDead() && conText.readyForNewCreep())
          conText.sendCreep(conText, panel, type);
       
      }
View Full Code Here

Examples of de.creepsmash.client.game.GameContext

        super(type, panel);
      }
     
      public void actionPerformed(ActionEvent event) {
       
        GameContext conText = this.panel.getContext();
        if (!conText.isDead() && conText.readyForNewWave())
          conText.sendCreepsWave(conText, panel, type);
      }
View Full Code Here

Examples of de.creepsmash.client.game.GameContext

      float dist = dX * dX + dY * dY;
      if (dist < distanceMin) {
        return lastCreep;
      }
    }
    GameContext context = tower.getContext();
    lastCreep = null;
    Creep found = null;
    int health = 0;
    for (Creep creep : context.getCreeps()) {
      if (creep.isValidTarget()) {
        float dX = creep.getX() - tower.getGrid().getX();
        float dY = creep.getY() - tower.getGrid().getY();
        // squared distance
        float dist = dX * dX + dY * dY;
 
View Full Code Here

Examples of de.creepsmash.client.game.GameContext

        this.type = type;
        this.panel = panel;
      }
     
      public void actionPerformed(ActionEvent event) {
        GameContext conText = this.panel.getContext();
        if (!conText.isDead())
          conText.buyTower(type);   
      }
View Full Code Here

Examples of hexenschach.gameplay.GameContext

    // Aktuellen Spielstand speichern
    // Sicherstellen, ob wirklich ein Gameplay vorhanden ist,
    // wird eigentlich schon dadurch gemacht, dass der SaveButton in diesem Fall ausgegraut sein sollte.
//    if(parent.getGameplay() == null) { 
      String title = input.getText();
      GameContext context = parent.getGameplay().getGameContext();
      parent.getPersistence().saveGame(title, context);
      // Löse ein Event aus, um andere Klassen zu benachrichtigen, dass ein Spiel gespeichert wurde
      GameEvent event = new GameEvent(this, GameEventType.GAME_SAVED);
      parent.gameEventHappened(event);
      setVisible(false);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.