Examples of AllroundVideoPlugin


Examples of eas.plugins.standard.visualization.AllroundVideoPlugin

            g.setBackground(Color.black);
            g.setColor(Color.yellow);
            g.drawString("" + this.versetzte, 10, 20);
            g.drawString(gs, 15, 30);

            AllroundVideoPlugin video = (AllroundVideoPlugin) umg
                    .getPluginObject(new AllroundVideoPlugin().id());
            if (video != null) {
                video.setDarBild(img);
            }

            if (this.anzahlGute(umg, params) == 0
                    || this.anzahlGute(umg, params) == umg.getRobAgents().size()) {
                this.anz++;
View Full Code Here

Examples of eas.plugins.standard.visualization.AllroundVideoPlugin

          fillEnv(params, umg);
      }

      if (this.clearAgent) {
          this.clearAgent = false;
          AllroundVideoPlugin vid = (AllroundVideoPlugin) umg.getSimTime().getPluginObject(new AllroundVideoPlugin().id());
          try {
                umg.removeAgent(vid.getMarkedAgentId());
            } catch (Exception e) {
            }
      }
     
      if (!pause && w.getLastTick() % 5 == 0) {
          PhysicsAgent2D<PhysEnvSimple> agent;
          if (new Random().nextBoolean()) {
              agent = new PhysAgentRectangleSimple((int) w.getLastTick(), umg, 10, params);
          } else {
                agent = new PhysAgentCircleSimple((int) w.getLastTick(), umg, 10, params);
          }
         
          umg.addAgent(agent, new Vector2D(15, 113), 90);
          agent.addForce(new Vector2f(-100000, 0));
      }
     
      if (insertAgent && w.getLastTick() % 1 == 0) {
            PhysicsAgent2D<PhysEnvSimple> agent;
            if (new Random().nextBoolean()) {
                agent = new PhysAgentRectangleSimple((int) w.getLastTick(), umg, 10, params);
            } else {
                agent = new PhysAgentCircleSimple((int) w.getLastTick(), umg, 10, params);
            }
           
            umg.addAgent(agent, new Vector2D(-70, 70), 0);
            agent.addForce(new Vector2f(0, 1000));
      }

        if (insertAgent2 && w.getLastTick() % 1 == 0) {
            PhysicsAgent2D<PhysEnvSimple> agent;
            if (new Random().nextBoolean()) {
                agent = new PhysAgentRectangleSimple((int) w.getLastTick(),
                        umg, 10, params);
            } else {
                agent = new PhysAgentCircleSimple((int) w.getLastTick(),
                        umg, 10, params);
            }

            umg.addAgent(agent, new Vector2D(-100, -30), 0);
            agent.addForce(new Vector2f(0, 1000));
        }

        if (insertAgent3 && w.getLastTick() % 1 == 0) {
            PhysicsAgent2D<PhysEnvSimple> agent;
            if (new Random().nextBoolean()) {
                agent = new PhysAgentRectangleSimple((int) w.getLastTick(),
                        umg, 10, params);
            } else {
                agent = new PhysAgentCircleSimple((int) w.getLastTick(),
                        umg, 10, params);
            }

            try {
                AllroundVideoPlugin vid = (AllroundVideoPlugin) umg.getSimTime().getPluginObject(new AllroundVideoPlugin().id());
                umg.addAgent(agent, umg.getAgentPosition(vid.getMarkedAgentId()), 0);
                agent.addForce(new Vector2f(0, 1000));
            } catch (Exception e) {
            }
           
        }
View Full Code Here

Examples of eas.plugins.standard.visualization.AllroundVideoPlugin

  public void step(Wink simTime) {
      super.step(simTime);
      this.setGravity(0, 40);

      try {
          AllroundVideoPlugin vid = (AllroundVideoPlugin) this.getSimTime().getPluginObject(new AllroundVideoPlugin().id());
          double cameraAngle = vid.getEnv2D().getVisualizationAngleRAD() + Math.PI / 2;
          Vector2D v = new Vector2D(Math.cos(cameraAngle), Math.sin(cameraAngle));
          this.setGravity((float) -(v.x * 2), (float) (v.y * 2));
        } catch (Exception e) {
        }
  }
View Full Code Here

Examples of eas.plugins.standard.visualization.AllroundVideoPlugin

        if (!this.nextAgentType.equals("fuse")) {
            this.nextAgent = this.generator.randomNTrisAgent(this.rand.nextInt(this.level) + 1);
        }

        if (this.getParCollection().getParValueBoolean("Polytris.Ultimate")) {
            AllroundVideoPlugin vid = (AllroundVideoPlugin) this.getSimTime().getPluginObject(new AllroundVideoPlugin().id());
            if (vid.getScale() > 50) {
                vid.setZoom2DMinus();
                vid.setZoom2DMinus();
            } else if (vid.getScale() < 15) {
                vid.setZoom2DPlus();
                vid.setZoom2DPlus();
            } else {
                if (rand.nextBoolean()) {
                    vid.setZoom2DMinus();
                    vid.setZoom2DMinus();
                } else {
                    vid.setZoom2DPlus();
                    vid.setZoom2DPlus();
                }
            }
        }
       
        float sum = 0;
View Full Code Here

Examples of eas.plugins.standard.visualization.AllroundVideoPlugin

            }
            if (e.getEventDescription().equals(ConstantsSimulation.KEY_EVENT_IDENTIFIER + " ")) {
                this.agentLowerCompletely(getCurrentAgentID(), true);
            }
            if (e.getEventDescription().equals(ConstantsSimulation.KEY_EVENT_IDENTIFIER + "p")) {
                AllroundVideoPlugin vid = ((AllroundVideoPlugin) this.getSimTime().getPluginObject(new AllroundVideoPlugin().id()));
                vid.pause();
            }
            if (e.getEventDescription().equals(ConstantsSimulation.KEY_EVENT_IDENTIFIER + "m")) {
                MP3Player.turnOffAllSounds = !MP3Player.turnOffAllSounds;
                if (MP3Player.turnOffAllSounds) {
                    for (MP3Player mp3 : MP3Player.activePlayers) {
                        mp3.requestStop();
                    }
                }
            }
            if (e.getEventDescription().equals(ConstantsSimulation.KEY_EVENT_IDENTIFIER + "b")) {
                if (this.bombs > 0 && !this.bombRunning) {
                    this.bombRunning = true;
                    this.showText = "Press 'b' for explosion";
                } else {
                    Vector2D pos = new Vector2D(this.getAgentPosition(this.bombAgent.id()));
                    int bricksRemoved = 0;
                   
                    for (int i = 0; i < this.bombs; i++) {
                        bricksRemoved += this.removeLine((int) pos.y);
                    }
                   
                    if (bricksRemoved > 0) {
                        this.veryHigh = false;
                    }
                   
                    int addPoints = bricksRemoved * 2 * this.bombs;
                    this.score += addPoints;
                   
                    this.playDestroyedLinesSound(this.bombs);
                    this.bombRunning = false;
                    this.setBombsNumber(0, addPoints);
                }
            }
            e = null;
        }
       
        if (simTime.getLastTick() == 0) {
            this.newRandomAgent(this.nextAgentType);
        }
        if (this.clock.pleaseLowerInCycle(simTime)) {
            this.lowerAgent();
            ((AllroundVideoPlugin) this.getSimTime().getPluginObject(
                    new AllroundVideoPlugin().id())).setMarkedAgentId(
                            this.agents.get(
                                    this.getCurrentAgentID()).getAgents().get(0).id());
        }
       
        endTime = System.currentTimeMillis();
View Full Code Here

Examples of eas.plugins.standard.visualization.AllroundVideoPlugin

    @Override
    public void runBeforeSimulation(
            TetrisEnvironment umg,
            ParCollection params) {
        super.runBeforeSimulation(umg, params);
        vidPlug = (AllroundVideoPlugin) umg.getSimTime().getPluginObject(new AllroundVideoPlugin().id());
        umg.getSimTime().requestEvents(vidPlug, new KeyEventFilter());
    }
View Full Code Here

Examples of eas.plugins.standard.visualization.AllroundVideoPlugin

                window.dispose();
            } catch (Exception e1) {
                System.out.println("Whoops!" + e1);
            }
           
            AllroundVideoPlugin vid = (AllroundVideoPlugin) umg.getSimTime().getPluginObject(new AllroundVideoPlugin().id());
            vid.showTooltipps(false);
            if (params.getParValueBoolean("Polytris.Ultimate")) {
//                vid.setZoom(new Rectangle2D(new Vector2D(0, 0), size.mult(100)));
                vid.setFollowAgent(true);
            }
        }
    }
View Full Code Here

Examples of eas.plugins.standard.visualization.AllroundVideoPlugin

      if (w.getLastTick() > 0) {
          return;
      }
     
      try {
          AllroundVideoPlugin vid = (AllroundVideoPlugin) umg.getSimTime().getPluginObject(new AllroundVideoPlugin().id());
          vid.setFitPerfectly(true);
        } catch (Exception e) {
        }
  }
View Full Code Here

Examples of eas.plugins.standard.visualization.AllroundVideoPlugin

  public void step(Wink simTime) {
      super.step(simTime);
      this.setGravity(0, 40);

      try {
          AllroundVideoPlugin vid = (AllroundVideoPlugin) this.getSimTime().getPluginObject(new AllroundVideoPlugin().id());
          double cameraAngle = vid.getEnv2D().getVisualizationAngleRAD() + Math.PI / 2;
          Vector2D v = new Vector2D(Math.cos(cameraAngle), Math.sin(cameraAngle));
          this.setGravity((float) -(v.x * 40), (float) (v.y * 40));
        } catch (Exception e) {
        }
 
View Full Code Here

Examples of eas.plugins.standard.visualization.AllroundVideoPlugin

     
      if (cyc.getLastTick() == 0) {
            params.setParValue(AllroundVideoPlugin.ROTATION_SPEED_PAR_NAME, 9.0);

            try {
        AllroundVideoPlugin vp = (AllroundVideoPlugin) environment.getSimTime().getPluginObject(new AllroundVideoPlugin().id());
        vp.setZoom2DPlus();
        vp.setZoom2DPlus();
        vp.setZoom2DPlus();
        vp.setZoom2DPlus();
        vp.setZoom2DPlus();
        vp.setZoom2DPlus();
        vp.setFollowAgent(true);
        Vector2D pos = environment.getPositionInVisualization(0);
        vp.setClickPosition((int) pos.x, (int) pos.y);
      } catch (Exception e) {
      }
      }
    }
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.