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

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


      updateScaledProperties();
      zoomOut=false;
    }
  }
  public Point ConvertToWorldPosition(Point p){
    Point clone=p.clone();
    clone.translate(getLeftX(), getTopY());
    Vector delta=scaledBoundsCorner.delta(clone);
    delta.divided(scale);
    clone.setPosition(bounds.getX()+delta.getVectorX(), bounds.getY()+delta.getVectorY());
    return clone;
  }
View Full Code Here


  private final SpriteSheet clouds;
  /* (non-Javadoc)
   * @see com.google.gwt.maeglin89273.game.mengine.utility.component.Spacial#isOutOfBounds(com.google.gwt.maeglin89273.game.mengine.utility.component.Physical)
   */
  public VolcanoWorld(int width,int height){
    super(new Point(0,0),width,height);
    this.background=MEngine.getAssetManager().getSpriteSheet("volcano_background.png");
    this.clouds=MEngine.getAssetManager().getSpriteSheet("clouds.png");
    world=new World(new Vec2(0,-10f),true);
    volcano=new Volcano(this,new Point(250,425));
   
  }
View Full Code Here

  public void add(Physical c) {
    fireballs.add(c);

  }
  public void erupt(){
    add(new FireBall(this,new Point(volcano.getLeftCraterPoint().getX()+Random.nextInt(Volcano.CRATER_WIDTH+1),volcano.getTopY()),2+Random.nextInt(5)));
  }
View Full Code Here

    context.drawImage(clouds.getImage(), 20, 30);
    context.restore();
  }
  @Override
  public WorldBounds getBounds(){
    return new WorldBounds(new Point(0,0),getWidth(),getHeight());
  }
View Full Code Here

    private final Point center;
    private final double width;
    private final double height;
    public WorldBounds(Point corner,double w,double h){
      this.corner=corner;
      this.center=new Point(corner.getX()+w/2,corner.getY()+h/2);
      this.width=w;
      this.height=h;
    }
View Full Code Here

  /* (non-Javadoc)
   * @see com.google.gwt.maeglin89273.game.mengine.utility.component.GeneralComponent#draw(com.google.gwt.canvas.dom.client.Context2d)
   */
  public Point getLeftCraterPoint(){
    return new Point(position.getX()-CRATER_WIDTH/2,getTopY());
  }
View Full Code Here

   */
  public Point getLeftCraterPoint(){
    return new Point(position.getX()-CRATER_WIDTH/2,getTopY());
  }
  public Point getRightCraterPoint(){
    return new Point(position.getX()+CRATER_WIDTH/2,getTopY());
  }
View Full Code Here

    return new Point(position.getX()+CRATER_WIDTH/2,getTopY());
  }
 
  @Override
  public void draw(Context2d context) {
    Point p=getPositionAt(PositionType.NORTHWEST);
   
    context.save();
    /*context.setShadowOffsetY(1);
    context.setShadowOffsetX(4);
    context.setShadowBlur(25);
    context.setShadowColor("hsla(22.5,50%,5%,0.3)");
    context.setShadowColor("rgba(0,0,0,0.2)");*/
    context.drawImage(image.getImage(),p.getX(),p.getY()-17, width, height+17);
    context.restore();
   
  }
View Full Code Here

   * @param sheet
   * @param imgWidthInGame
   * @param imgHeightInGame
   */
  public ImageLayer(SpriteSheet sheet,int imgWidthInGame,int imgHeightInGame){
    this(sheet, new Point(0,0), imgWidthInGame, imgHeightInGame);
  }
View Full Code Here

      FixtureDef triFixD=new FixtureDef();
      FixtureDef recFixD=new FixtureDef();
      PolygonShape triShape=new PolygonShape();
      PolygonShape recShape=new PolygonShape();
     
      Vector[] verticesP=new Vector[]{new Vector(rSin15,rCos15),new Vector(radius,0),new Vector(rSin15,-rCos15)};
      Vec2[] verticesW=new Vec2[3];
      for(int i=0;i<3;i++){
        verticesW[i]=CoordinateConverter.vectorPixelToWorld(verticesP[i]);
      }
      triShape.set(verticesW, verticesW.length);
      recShape.setAsBox(CoordinateConverter.scalerPixelsToWorld(hw),
          CoordinateConverter.scalerPixelsToWorld(radius*0.6) ,
          CoordinateConverter.vectorPixelToWorld(new Vector(rSin15-hw,0)),0);
     
      triFixD.isSensor=true;
      recFixD.isSensor=true;
      triFixD.shape=triShape;
      recFixD.shape=recShape;
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.