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

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


  public void draw(Context2d context) {
    root.draw(context);
  }
  @Override
  public void onScreen() {
    Point center=new Point(getGameWidth()/2,getGameHeight()/2);
    clickLabel=new GameLabel(new Point(center.getX(),center.getY()+32), TextAlign.CENTER, TextBaseline.MIDDLE, "click here to continue", ASBOTXConfigs.Color.WHITE, clickTextFont);
    root=new GroupLayer();
    if(level.hasHint()){
      this.button=new HintButton(new Point(center.getX(),center.getY()+225));
      root.addComponentOnLayer(button);
    }
    root.addComponentOnLayer(new GameLabel(center, TextAlign.CENTER, TextBaseline.MIDDLE, "Pause", ASBOTXConfigs.Color.WHITE, pauseTextFont));
    root.addComponentOnLayer(clickLabel);
    root.addComponentOnLayer(new Glass(getGameWidth(),getGameHeight()));
View Full Code Here


   * @param p
   * @param w
   * @param h
   */
  public Glass(double w, double h) {
    super(new Point(w/2,h/2), w, h);
   
  }
View Full Code Here

    public void doTask() {
     
      root.removeLayer(0);
      root.insertLayer(0,
          new ImageLayer(MEngine.getAssetManager().getSpriteSheet("images/hints/"+level.getWorldType()+"_hint_"+level.getLevelNumber()+".png"),
          new Point((getGameWidth()-HINT_WIDTH)/2,(getGameHeight()-HINT_HEIGHT)/2), HINT_WIDTH, HINT_HEIGHT));
      clickLabel.setText("click anywhere to continue");
      clickLabel.setY(30);
      button=null;
    }
View Full Code Here

 
  private CheckBox[] boxes;
 
  private final double screenHeight;
  public TasksList(double centerX,double screenHeight) {
    super(new Point(centerX,0), WIDTH, 0);
    this.screenHeight = screenHeight;
    block=new SpriteBlock(0,0,255,0,MEngine.getAssetManager().getSpriteSheet("images/tutorial_tasks.png"));
  }
View Full Code Here

    this.enabled=enabled;
  }
  public void setup(int h,int blockY,int checkBoxesNum){
    setEnabled(true);
    this.setHeight(h);
    this.setPositionAt(PositionType.NORTH, new Point(getX(),screenHeight-getHeight()-10));
    block.setHeight(h);
    block.setY(blockY);
    boxes=new CheckBox[checkBoxesNum];
    double offsetY=getTopY()+20;
    for(int i=0;i<boxes.length;i++){
      boxes[i]=new CheckBox(new Point(getLeftX()+BOX_X_OFFSET,offsetY+BOX_Y_SPACING*i));
    }
  }
 
View Full Code Here

        if(specialPage!=null){
          getGame().setPage(specialPage);
        }else{
          getGame().setPage(new ASBOTXGamePage(
              new Level(MEngine.getAssetManager().getJson(path),
              new Point(getGameWidth()/2.0,getGameHeight()/2.0))));
        }   
      }catch(IllegalArgumentException e){//the last level
        getGame().setPage(new EndingPage());
      }
     
View Full Code Here

    private int showingShapesCount;
    private static final float SPACING=23;
    private ShapeDefiner[] shapes;
   
    public ShapesLineDefiner(){
      super(75,new Point(4*ICON_BOUNDS_PLUS_SPACING,ICON_BOUNDS_PLUS_SPACING));
     
      this.shapesMaxCount=(int)Math.floor(Line.MAX_LENGTH/SPACING);//200 is the max length of line
      shapes=new ShapeDefiner[shapesMaxCount];
      reset();
    }
View Full Code Here

   */
  protected Shelf(Creator creator, Point commonPoint,double width, double angle,boolean reverse) {
    super(creator, commonPoint, angle);
    this.commonPoint=commonPoint;
    if(reverse){
      longerLinePoint=new Point(this.commonPoint.getX()+width*2/3,this.commonPoint.getY()-width*1/2);
      shorterLinePoint=new Point(this.commonPoint.getX()-width*1/3,this.commonPoint.getY()-width*4/9);
    }else{
      longerLinePoint=new Point(this.commonPoint.getX()-width*2/3,this.commonPoint.getY()-width*1/2);
      shorterLinePoint=new Point(this.commonPoint.getX()+width*1/3,this.commonPoint.getY()-width*4/9);
    }
    Point[] ps=Point.getRotatedPoint(commonPoint, this.angle, longerLinePoint,shorterLinePoint);
    longerLinePoint=ps[0];
    shorterLinePoint=ps[1];
  }
View Full Code Here

   
  }

  @Override
  public void onScreen() {
    Point center=new Point(getGameWidth()/2,getGameHeight()/2);
    this.creator=new Creator(new Level(MEngine.getAssetManager().getJson("levels/testing.json"),center));
    creator.build(new GameOverCallback(){

      @Override
      public void showScore(int score) {
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();
    if(!board.select(p))back.onClick(p);
   
  }
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.