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

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


  /* (non-Javadoc)
   * @see com.google.gwt.maeglin89273.game.mengine.page.Page#onScreen()
   */
  @Override
  public void onScreen() {
    layers.addComponentOnLayer(new GameLabel(new Point(getGameWidth()/2,60),TextAlign.CENTER,TextBaseline.MIDDLE,
                             world.getTitle(),ASBOTXConfigs.Color.GRAY,ASBOTXConfigs.getCGFont(32)));
   
    board=new ButtonBoard(400,getGameWidth()/2-200,110);
    back=new BackButton(new Point(30,30),25);
    layers.addComponentOnLayer(board);
    layers.addComponentOnLayer(back);
  }
View Full Code Here


    private double bounds;
   
    private int cornerX;
    private int cornerY;
    ButtonBoard(double bounds,int cornerX,int cornerY){
      super(new Point(cornerX+bounds/2,cornerY+bounds/2), bounds, bounds);
      this.cornerX=cornerX;
      this.cornerY=cornerY;
      this.bounds=bounds;
     
      bounds-=2*SPACING;
      bounds/=3;
      int counter=0;
     
      for(int i=0;i<buttons.length;i++){
        for(int j=0;j<buttons[i].length;j++){
        buttons[i][j]=new LevelSelectButton(new Point(cornerX+bounds/2+j*(bounds+SPACING),
                          cornerY+bounds/2+i*(bounds+SPACING)),
                          bounds,world,++counter,
                          localPlayer.isLevelUnlocked(world,counter));//adjust later
        }
      }
View Full Code Here

        }
      }
    }
     boolean select(Point p){
      if(p.getX()>cornerX&&p.getX()<cornerX+bounds&&p.getY()>cornerY&&p.getY()<cornerY+bounds){
        Point cl=p.clone();
        cl.translate(-cornerX,-cornerY);
       
        int i=(int)(cl.getY()*buttons.length/bounds);
        int j=(int)(cl.getX()*buttons.length/bounds);
        if(buttons[i][j]!=null&&buttons[i][j].onClick(p)){
          return true;
        }
        return false;
      }
View Full Code Here

        if(cross*cross<=ASBOTXConfigs.E_SQUARE*v0.getSquare()*v1.getSquare()){
          reset();
          return c;
        }
        if(cross<0){
          Point tmp=vertices[0];
          vertices[0]=vertices[1];
          vertices[1]=tmp;
        }
       
        relativeVertices=new Vector[3];
        g=new Point((vertices[0].getX()+vertices[1].getX()+vertices[1].getX())/3,
              (vertices[0].getY()+vertices[1].getY()+vertices[1].getY())/3);
        for(int i=0;i<3;i++){
          relativeVertices[i]=g.delta(vertices[i]);
        }
        c=defineFinished();
View Full Code Here

  /**
   *
   */
  public GuidePage() {
    buttons[0]=new GuideButton(getGameHeight()/2);
    buttons[1]=new WelcomeButton(new Point(25,25),50);
    mainLayer=new WorldLayer(new TutorialImage(),1);
    root=new GroupLayer();
    this.camera=mainLayer.getCamera();
  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent)
   */
  @Override
  public void onClick(ClickEvent event) {
    Point p=MEngine.getMousePosition();
    for(int i=0;i<buttons.length&&!buttons[i].onClick(p);i++);
  }
View Full Code Here

   * @see com.google.gwt.maeglin89273.game.mengine.game.HasGameLoop#update()
   */
  @Override
  public void update() {
    if(grabPos!=null){
      Point mP=MEngine.getMousePosition();
      Vector v=mP.delta(grabPos);
      v.setVectorX(0);
      camera.move(v, true);
      grabPos.setPosition(mP);
    }
    root.update();
View Full Code Here

  public void onScreen() {
    for(GameButton  button:buttons){
      root.addComponentOnLayer(button);
    }
    root.addLayer(mainLayer);
    camera.setPosition(new Point(getGameWidth()/2,getGameHeight()/2));
  }
View Full Code Here

    camera.setPosition(new Point(getGameWidth()/2,getGameHeight()/2));
  }
  private class TutorialImage extends GeneralComponent{
    private SpriteSheet img;
    protected TutorialImage() {
      super(new Point(720,710), 1440, 1420);
      this.img=MEngine.getAssetManager().getSpriteSheet("images/guide.png");
    }
View Full Code Here

    private boolean next=true;
    private boolean moving=false;
    private int count=0;
    private double vY;
    public GuideButton(double y) {
      super(new Point(getGameWidth()-30,y), 25,new SpriteBlock(4*(200+SpriteBlock.SPACING),2*(200+SpriteBlock.SPACING),200,200, ASBOTXConfigs.Utility.getButtonsSpriteSheet()));
     
    }
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.