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

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


   */
  public Cross(Point p,double angle) {
    super(0, p, 15*(1+SQRT_2), 15*(1+SQRT_2/2),angle);
   
    Vec2 crossV=CoordinateConverter.vectorPixelToWorld(position.delta(getX(),getTopY()+getWidth()/2));
    Point nwP=this.getPositionAt(PositionType.NORTHWEST);
    Point neP=this.getPositionAt(PositionType.NORTHEAST);
    Point seP=nwP.clone();
    Point swP=neP.clone();
    seP.translate(getHeight(), getHeight());
    swP.translate(-getHeight(), getHeight());
    this.points=Point.getRotatedPoint(getPosition(),getAngle(),nwP,neP,seP,swP);
   
    BodyDef bodyD=new BodyDef();
    PolygonShape[] edges=new PolygonShape[]{new PolygonShape(),new PolygonShape(),new PolygonShape(),new PolygonShape()};
   
View Full Code Here


  private class InformationRoll extends GeneralComponent implements MouseWheelHandler{
    private SpriteBlock block;
    private static final int V=1;
   
    protected InformationRoll(double w, double h) {
      super(new Point(getGameWidth()/2,getGameHeight()+h/2), w, h);
      this.block=new SpriteBlock((int)w,(int)h, MEngine.getAssetManager().getSpriteSheet("images/information.png"));
    }
View Full Code Here

     * @param creator
     * @param requiredFullPower
     * @param iconCorner
     */
    public NoneDefiner() {
      super(0, new Point(3*ICON_BOUNDS_PLUS_SPACING,2*ICON_BOUNDS_PLUS_SPACING));
     
    }
 
View Full Code Here

    if(verticesCount>8){
      throw new IllegalArgumentException("too many vertices!");
    }else if(verticesCount<3){
      throw new IllegalArgumentException("too few vertices!");
    }
    Point g=new Point(0,0);
    double theta=2*Math.PI/verticesCount;
    double angle=0;
    Point[] verticesP=new Point[verticesCount];
    Vector[] vertices=new Vector[verticesCount];
    for(int c=0;c<vertices.length;c++){
      //angle+=(2*Math.PI-angle)*Random.nextDouble(); this is the other way to create a vertex
      angle=theta*Random.nextDouble()+c*theta;
      verticesP[c]=new Point(circumscribedCircleRadius,angle,true);
      g.translate(verticesP[c].getX(), verticesP[c].getY());
    }
    g.setPosition(g.getX()/verticesCount, g.getY()/verticesCount);
   
    for(int i=0;i<vertices.length;i++){
      vertices[i]=new Vector(verticesP[i].getX()-g.getX(),verticesP[i].getY()-g.getY());
    }
    return vertices;
  }
View Full Code Here

  private Creator creator;
 
  private GameButton[] buttons=new GameButton[3];
 
  public WelcomePage() {
    super(new Point(getGameWidth()-50,getGameHeight()-50),
        new Point(getGameWidth()/2,getGameHeight()-12),100,TextAlign.CENTER,ASBOTXConfigs.Color.GRAY);
  }
View Full Code Here

  @Override
  public void onMouseDown(MouseDownEvent event) {
    if(isBlocked()){
      return ;
    }
    Point p=MEngine.getMousePosition();
    boolean result=true;
    for(GameButton button:buttons){
      result&=!button.contains(p);
    }
    if(result){
View Full Code Here

    MEngine.addMouseUpHandler(this);
   
  }
  @Override
  public void onScreen() {
    this.buttons[0]=new StartButton(new Point(getGameWidth()/2.0,getGameHeight()/2.0));
    this.buttons[1]=new InformationButton(new Point(55,getGameHeight()-55));
    this.buttons[2]=new GuideButton(new Point(55,getGameHeight()-160));
   
    this.creator=new Creator(new Level(MEngine.getAssetManager().getJson("levels/welcome_level.json"),new Point(getGameWidth()/2,getGameHeight()/2)));
    creator.build(new GameOverCallback(){

      @Override
      public void showScore(int score) {
        WelcomePage.this.buttons[0].doTask();       
      }
     
    });
   
    for(GameButton button:buttons){
      root.addComponentOnLayer(button);
    }
     
    root.addLayer(new ImageLayer(MEngine.getAssetManager().getSpriteSheet("images/welcome_bg.png"), new Point(0,0), getGameWidth(), getGameHeight()));
    root.addComponentOnLayer(new GameLabel(new Point(getGameWidth()-5,3), TextAlign.RIGHT, TextBaseline.TOP, ASBOTXConfigs.VERSION, ASBOTXConfigs.Color.TEXT, ASBOTXConfigs.getCGFont(12)));
    root.addComponentOnLayer(creator.getWorld());
  }
View Full Code Here

 
  public static class WoodLineDefiner extends StaticLineDefiner{

    public WoodLineDefiner(){
      super(ASBOTXConfigs.CreationPowerComsumption.WOOD_LINE,
      new Point(ICON_BOUNDS_PLUS_SPACING,ICON_BOUNDS_PLUS_SPACING),ASBOTXConfigs.Color.WOOD);
    }
View Full Code Here

 
 
  public static class ElasticLineDefiner extends StaticLineDefiner{

    public ElasticLineDefiner() {
      super(ASBOTXConfigs.CreationPowerComsumption.ELASTIC_LINE,new Point(2*ICON_BOUNDS_PLUS_SPACING,ICON_BOUNDS_PLUS_SPACING),ASBOTXConfigs.Color.LIGHT_BLUE);
    }
 
View Full Code Here

      this.angle = angle;
     
    }
    @Override
    public void setupTask(TutorialManager manager) {
      manager.getBlueMark(index).setup(new Point(x, y), angle);
    }
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.