Package com.google.gwt.maeglin89273.game.mengine.physics

Examples of com.google.gwt.maeglin89273.game.mengine.physics.Point


   * @param p
   * @param w
   * @param h
   */
  public CreatorPanel(Creator creator,double screenWidth,double screenHeight) {
    super(new Point(screenWidth*3/16,screenHeight-screenWidth*1/16), screenWidth*3/8, screenWidth*1/8);
    double halfH=getHeight()/2;
    double oneThirdW=getWidth()/3;
    this.creator=creator;
    this.keys[AREA_KEY_INDEX]=new AreaKey(new Point(getX()-oneThirdW,getTopY()+halfH),oneThirdW,getHeight(),creator.getLevel().getAreaDefinerKinds());
    this.keys[LINE_KEY_INDEX]=new LineKey(new Point(getX(),getTopY()+halfH),oneThirdW,getHeight(),creator.getLevel().getLineDefinerKinds());
    this.keys[DOT_KEY_INDEX]=new DotKey(new Point(getX()+oneThirdW,getTopY()+halfH),oneThirdW,getHeight(),creator.getLevel().getDotDefinerKinds());
 
  }
View Full Code Here


  }

  @Override
  public void onMouseUp(MouseUpEvent event) {
    if(event.getNativeButton()==NativeEvent.BUTTON_LEFT){
      Point mP=MEngine.getMousePosition();
     
      //notify the pen is up
      //detect step 3
      manager.getDetector().detect(3, creatorPanel.onPenUp(camera.ConvertToWorldPosition(mP)));
      if(!creatorPanel.isAnyKeyPressed()&&grabPos!=null){
        worldLayer.getCamera().move(mP.delta(grabPos), false);
        grabPos=null;
      }
    }
  }
View Full Code Here

   * @see com.google.gwt.maeglin89273.game.mengine.utility.page.Page#update()
   */
  @Override
  public void update() {
    if(grabPos!=null){
      Point mP=MEngine.getMousePosition();
      Vector v=mP.delta(grabPos);
      worldLayer.getCamera().move(v, true);
      grabPos.setPosition(mP);
     
      //detect step 1
      manager.getDetector().detect(1, v);
View Full Code Here

 
  public static class ShinyBallBuilder implements LevelBuilder{

    @Override
    public void build(JSONObject creation) {
      new ShinyBall( new Point(creation.get(X).isNumber().doubleValue(),
                        creation.get(Y).isNumber().doubleValue()));
     
    }
View Full Code Here

   
    //init here
    manager=new TutorialManager(MEngine.getAssetManager().getJson("configs/tutorial_configs.json"),
        getGameWidth(),getGameHeight(),2,TASK_HANDLERS);
    this.level=new Level(MEngine.getAssetManager().getJson("levels/tutorial_level.json"),
     new Point(getGameWidth()/2.0,getGameHeight()/2.0));
    this.creator=new Creator(level);
   
    creator.build(new GameOverCallback(){

      @Override
View Full Code Here

    @Override
    public void build(JSONObject creation) {
      JSONObject pos=creation.get(POSITION).isObject();
      new Cross(
          new Point(pos.get(X).isNumber().doubleValue(),
                 pos.get(Y).isNumber().doubleValue()),
          Math.toRadians(creation.get(ANGLE).isNumber().doubleValue()));
                
     
    }
View Full Code Here

   
    @Override
    public void build(JSONObject creation) {
      JSONObject pos=creation.get(POSITION).isObject();
      new RedGoblet(
          new Point(pos.get(X).isNumber().doubleValue(),
                 pos.get(Y).isNumber().doubleValue()),
                Math.toRadians(creation.get(ANGLE).isNumber().doubleValue()),
               (int)creation.get("gAng").isNumber().doubleValue());
    }
View Full Code Here

   * @param screenHeight TODO
   * @param w
   * @param h
   */
  public CreatorPropertiesBar(int screenWidth, int screenHeight,int maxPower,int lastScore,int requiredScore) {
    super(new Point(screenWidth*7/8f-20,screenHeight*25/54f), screenWidth/4f, screenHeight*25/27f);
    this.barLength=this.powerBarLength=this.expectativePowerBarLength=this.scoreFlagPos=getHeight()*0.9;
    this.powerBarX=getRightX()-1.5;
    this.expectativePowerBarX=getRightX()-4.5;
    this.textBaselineY=(float)getHeight()*0.05f;
    this.font=ASBOTXConfigs.getCGFont((int)(screenWidth*13/360f));
 
View Full Code Here

 
  private Step[] steps;
  public TutorialManager(JsonFile configs,double gameWidth,double gameHeight,int markNum,TaskHandler[] handlers){
    this.detector=new TaskDetector(this);
   
    this.board=new StepBoard(new Point(10,10),gameWidth/2);
   
    this.taskCmpts=new StepComponent[2+(markNum<1?1:markNum)];
    this.taskCmpts[BUTTON_INDEX]=new NextStepButton(new Point(gameWidth-130,gameHeight-60),this);
    this.taskCmpts[LIST_INDEX]=new TasksList(gameWidth-185,gameHeight)
    for(int i=2;i<this.taskCmpts.length;i++){
      this.taskCmpts[i]=new BlueMark();
    }
   
View Full Code Here

   * @param h
   * @param block
   * @param definers
   */
  public AreaKey(Point p, double w, double h,String[] kinds) {
    super(p, w, h, new Point(0,0),DefinersFactory.getDefiners(kinds));
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.maeglin89273.game.mengine.physics.Point

Copyright © 2018 www.massapicom. 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.