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

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


    return new Circle(this.controller,position,10, this.dotColor);
  }
  public static class CircleBombDotDefiner extends BombDotDefiner{

    public CircleBombDotDefiner() {
      super(new Point(0,2*ICON_BOUNDS_PLUS_SPACING),ASBOTXConfigs.Color.BLUE);
     
    }
 
View Full Code Here


    @Override
    public void buildArea(JSONObject jsonArea) {
      JSONObject pos=jsonArea.get(POSITION).isObject();
      new ArrowArea(
          new Point(pos.get(X).isNumber().doubleValue(),
                pos.get(Y).isNumber().doubleValue()),
                Math.toRadians(jsonArea.get(ANGLE).isNumber().doubleValue()),
                jsonArea.get("r").isNumber().doubleValue());
     
    }
View Full Code Here

 
  @Override
  public void onMouseDown(MouseDownEvent event) {
    switch(event.getNativeButton()){
      case NativeEvent.BUTTON_LEFT:
        Point mP=MEngine.getMousePosition();
       
        //notify the pen is down
        creatorPanel.onPenDown(camera.ConvertToWorldPosition(mP));
        if(!creatorPanel.isAnyKeyPressed())
          grabPos=mP;
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
      creatorPanel.onPenUp(camera.ConvertToWorldPosition(mP));
      if(!creatorPanel.isAnyKeyPressed()){
        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();
      worldLayer.getCamera().move(mP.delta(grabPos), true);
      grabPos.setPosition(mP);
    }
    creator.restore();
    super.update();
   
View Full Code Here

    return new Rectangle(this.controller, position , angle, 5+Random.nextInt(16), 5+Random.nextInt(16), this.dotColor);
  }
  public static class RectangleBombDotDefiner extends BombDotDefiner{

    public RectangleBombDotDefiner() {
      super(new Point(ICON_BOUNDS_PLUS_SPACING,2*ICON_BOUNDS_PLUS_SPACING),ASBOTXConfigs.Color.YELLOW_BORDER);
     
    }
 
View Full Code Here

    return new Polygon(this.controller, position, angle ,Polygon.generateRandomInscribedPolygonVertices(3+Random.nextInt(6), 13+Random.nextInt(3)), dotColor);
  }
  public static class PolygonBombDotDefiner extends BombDotDefiner{

    public PolygonBombDotDefiner() {
      super(new Point(2*ICON_BOUNDS_PLUS_SPACING,2*ICON_BOUNDS_PLUS_SPACING), ASBOTXConfigs.Color.RED);
     
    }
View Full Code Here

  @Override
  public void onScreen() {
    final ASBOTXGame game=(ASBOTXGame)getGame();
    game.initLocalPlayer();
    layers=new GroupLayer();
    layers.addComponentOnLayer(new GameLabel(new Point(getGameWidth()/2,getGameHeight()/2),
        TextAlign.CENTER, TextBaseline.MIDDLE, "Loading...", ASBOTXConfigs.Color.WHITE,
        ASBOTXConfigs.getCGFont(26)));
    layers.addComponentOnLayer(new LoadingBar(35));
    layers.addComponentOnLayer(new Glass(getGameWidth(), getGameHeight()));
   
View Full Code Here

  }
  @Override
  public void update() {
    if(lastShapesCount>0){
      double angle=lastShapesCount*PORTION_ANGLE;
      Point pos=this.position.clone();
      pos.translate(new Vector(spoutDistance,angle,true));
      Vec2 impulse=new Vec2((float)(this.impulseMag*Math.cos(angle)),(float)(this.impulseMag*Math.sin(angle)));
     
      PhysicalShape shape=generateShape(pos,angle);
      if(shape.isVerified()){
        shape.getBody().applyLinearImpulse(impulse,shape.getBody().getWorldCenter());
View Full Code Here

 
  private class LoadingBar extends GeneralComponent{
    private int percentage;
   
    protected LoadingBar(int yOffset){
      super(new Point(getGameWidth()/2,getGameHeight()/2+yOffset), 400, 10);
    }
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.