Package com.google.gwt.maeglin89273.game.ashinyballonthecross.client.core.ui

Examples of com.google.gwt.maeglin89273.game.ashinyballonthecross.client.core.ui.Glass


   * @param w
   * @param h
   * @param block
   */
  public DotKey(Point p, double w, double h,String[] kinds) {
    super(p, w, h,new Point(400+2*SpriteBlock.SPACING,0),DefinersFactory.getDefiners(kinds));
   
  }
 
View Full Code Here


   * @param w
   * @param h
   * @param kinds
   */
  public LineKey(Point p,double w,double h,String[] kinds){
    super(p, w, h, new Point(200+SpriteBlock.SPACING,0),DefinersFactory.getDefiners(kinds));
  }
View Full Code Here

  public static class MagneticLineDefiner extends StaticLineDefiner{

    public MagneticLineDefiner() {
       
      super(ASBOTXConfigs.CreationPowerComsumption.MAGNETIC_LINE,
          new Point(3*ICON_BOUNDS_PLUS_SPACING,ICON_BOUNDS_PLUS_SPACING), null);
     
    }
View Full Code Here

     
    }
    @Override
    public void sketch(Context2d context){
      if(pointA!=null&&pointB!=null){
        Point center=Point.getCenter(pointA, pointB);
        context.setLineWidth(2);
        context.setStrokeStyle(Color.RED);
        context.beginPath();
        context.moveTo(pointA.getX(),pointA.getY());
        context.lineTo(center.getX(),center.getY());
        context.stroke();
       
        context.setStrokeStyle(Color.BLUE);
        context.beginPath();
        context.moveTo(center.getX(),center.getY());
        context.lineTo(pointB.getX(), pointB.getY());
        context.stroke();
      }
    }
View Full Code Here

 
  @Override
  public void onMouseDown(MouseDownEvent event) {
    switch(event.getNativeButton()){
      case NativeEvent.BUTTON_LEFT:
        Point mP=MEngine.getMousePosition();
       
        //return because the next step button is clicked
        if(manager.getButton().onClick(mP)){
          return;
        }
View Full Code Here

   * @param p
   * @param w
   * @param h
   */
  public CreatorPanel(Creator creator,double screenWidth,double screenHeight) {
    super(new Point(screenWidth*3/16,screenHeight-screenWidth*1/16), screenWidth*3/8, screenWidth*1/8);
    double halfH=getHeight()/2;
    double oneThirdW=getWidth()/3;
    this.creator=creator;
    this.keys[AREA_KEY_INDEX]=new AreaKey(new Point(getX()-oneThirdW,getTopY()+halfH),oneThirdW,getHeight(),creator.getLevel().getAreaDefinerKinds());
    this.keys[LINE_KEY_INDEX]=new LineKey(new Point(getX(),getTopY()+halfH),oneThirdW,getHeight(),creator.getLevel().getLineDefinerKinds());
    this.keys[DOT_KEY_INDEX]=new DotKey(new Point(getX()+oneThirdW,getTopY()+halfH),oneThirdW,getHeight(),creator.getLevel().getDotDefinerKinds());
 
  }
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
      //detect step 3
      manager.getDetector().detect(3, creatorPanel.onPenUp(camera.ConvertToWorldPosition(mP)));
      if(!creatorPanel.isAnyKeyPressed()&&grabPos!=null){
        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();
      Vector v=mP.delta(grabPos);
      worldLayer.getCamera().move(v, true);
      grabPos.setPosition(mP);
     
      //detect step 1
      manager.getDetector().detect(1, v);
View Full Code Here

 
  public static class ShinyBallBuilder implements LevelBuilder{

    @Override
    public void build(JSONObject creation) {
      new ShinyBall( new Point(creation.get(X).isNumber().doubleValue(),
                        creation.get(Y).isNumber().doubleValue()));
     
    }
View Full Code Here

   
    //init here
    manager=new TutorialManager(MEngine.getAssetManager().getJson("configs/tutorial_configs.json"),
        getGameWidth(),getGameHeight(),2,TASK_HANDLERS);
    this.level=new Level(MEngine.getAssetManager().getJson("levels/tutorial_level.json"),
     new Point(getGameWidth()/2.0,getGameHeight()/2.0));
    this.creator=new Creator(level);
   
    creator.build(new GameOverCallback(){

      @Override
View Full Code Here

TOP

Related Classes of com.google.gwt.maeglin89273.game.ashinyballonthecross.client.core.ui.Glass

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.