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

Examples of com.google.gwt.maeglin89273.game.ashinyballonthecross.client.core.creation.MainCreation


* @author Maeglin Liao
*
*/
public class BackButton extends CircleButton{
  public BackButton(Point p,double r) {
    super(p,r, new SpriteBlock(5*(200+SpriteBlock.SPACING),2*(200+SpriteBlock.SPACING),200,200, ASBOTXConfigs.Utility.getButtonsSpriteSheet()));
  }
View Full Code Here


   * @param w
   * @param h
   * @param block
   */
  public WelcomeButton(Point p,double bounds) {
    super(p,bounds,bounds, new SpriteBlock(5*(200+SpriteBlock.SPACING),0,200,200,ASBOTXConfigs.Utility.getButtonsSpriteSheet()));
    // TODO Auto-generated constructor stub
  }
View Full Code Here

  protected final CreationDefiner[] definers;
  protected int index=0;
  protected boolean pressed;
  protected final Point unPressedBlockPos;
  protected CreativeKey(Point p, double w, double h,Point unPressedBlockPos,CreationDefiner[] definers) {
    super(p, w, h,new SpriteBlock((int)unPressedBlockPos.getX(),(int)unPressedBlockPos.getY(),200,200,
        MEngine.getAssetManager().getSpriteSheet("images/buttons.png")));
    this.unPressedBlockPos = unPressedBlockPos;
   
    this.definers = definers;
   
View Full Code Here

  }
  @Override
  public void draw(Context2d context){
    super.draw(context);
    if(pressed){
      SpriteBlock sb=getDefiner().getDefinerIcon();
      context.drawImage(sb.getSheetImage(), sb.getX(), sb.getY(), sb.getWidth(), sb.getHeight(),getLeftX(),getTopY(), getWidth(), getHeight());
    }
  }
View Full Code Here

   
    buttons[0]=new BackButton(new Point(55,getGameHeight()-60), 50);
    buttons[1]=new RefreshButton(new Point(getGameWidth()/2,getGameHeight()-60),50);
   
    table=new LeaderboardTable(new Point(getGameWidth()/2,getGameHeight()/2));
    progressLabel=new GameLabel(new Point(getGameWidth()/2,108), TextAlign.CENTER, TextBaseline.MIDDLE,
        "", ASBOTXConfigs.Color.BORDER_DARK_GRAY, ASBOTXConfigs.getCGFont(12));
    totalLabel=new GameLabel(new Point(getGameWidth()-3,108), TextAlign.RIGHT, TextBaseline.MIDDLE,
        "Total "+game.getLocalPlayer().getTotal(), ASBOTXConfigs.Color.BORDER_DARK_GRAY,
        ASBOTXConfigs.getCGFont(12));
   
    //put the components on root
   
View Full Code Here

    private final String font=ASBOTXConfigs.getCGFont(15);
    private final String boldFont=ASBOTXConfigs.getCGBoldFont(15);
   
    public LeaderboardTable(Point p) {
      super(p, getGameWidth(),300);
      bigLabel=new GameLabel(p, TextAlign.CENTER, TextBaseline.MIDDLE,"",
          ASBOTXConfigs.Color.GRAY, ASBOTXConfigs.getCGFont(45));
      hightlightOffset=getTopY()+15;
    }
View Full Code Here

      super(buttonPos, bounds,bounds,new SpriteBlock(3*(200+SpriteBlock.SPACING),
          chooseSpriteBlockY(ASBOTXConfigs.Utility.switchStatus(game.getLoginInfo().getStatus())),
          200,200,ASBOTXConfigs.Utility.getButtonsSpriteSheet()));
     
      if(game.getLoginInfo().isConnectionSuccess()){
        this.label=new GameLabel(labelPos,align, TextBaseline.MIDDLE,
            game.getLoginInfo().getStatus()==LoginInfo.Status.LOGGED_IN?game.getLocalPlayer().getID():"",
            labelColor, ASBOTXConfigs.getCGFont(12));
      }else{
        setEnabled(false);
      }
View Full Code Here

   * @see com.google.gwt.maeglin89273.game.mengine.component.GeneralComponent#update()
   */
  @Override
  public void update() {
   
    Physical dc;
    for(int i=contentCreations.size()-1;i>=0;i--){
      dc=contentCreations.get(i);
      if(dc.isDestroyed()){
        contentCreations.remove(i);
      }else{
        dc.getBody().applyForce(forceVec, dc.getBody().getWorldCenter());
      }
    }
  }
View Full Code Here

  @Override
  public void update(){
    Vec2 shapePos;
    Vec2 pAToShape;
    Vec2 pBToShape;
    Physical dc;
    for(int i=creationsInField.size()-1;i>=0;i--){
      dc=creationsInField.get(i);
      if(dc.isDestroyed()){
        creationsInField.remove(i);
      }else{
        shapePos=dc.getBody().getWorldCenter();
        pAToShape=shapePos.sub(vecA);
        pBToShape=shapePos.sub(vecB);
        if(Vec2.dot(pAToShape, vecAToB)<0){
          if(pAToShape.lengthSquared()>ASBOTXConfigs.E_SQUARE){
            pAToShape.negateLocal();
            pAToShape.normalize();
            pAToShape.mulLocal(FORCE_MAGNITUDE);
            dc.getBody().applyForce(pAToShape,shapePos);
          }
        }else if(Vec2.dot(pBToShape, vecBToA)<0){
          if(pBToShape.lengthSquared()>ASBOTXConfigs.E_SQUARE){
            pBToShape.negateLocal();
            pBToShape.normalize();
            pBToShape.mulLocal(FORCE_MAGNITUDE);
            dc.getBody().applyForce(pBToShape,shapePos);
          }
        }else{
          dc.getBody().applyForce(Vec2.cross(pAToShape,vecAToB)>0?forces[0]:forces[1],shapePos);
        }
      }
    }
  }
View Full Code Here

      for(int i=0;i<transX.length;i++){
        transX[i]=(i-currentIndex+1)*SPACING;
      }
     
     
      sensorButton=new BoxButton(getPosition(), 220, 220, null){
       
        @Override
        public void doTask() {
          buttons[currentIndex].doTask();
         
View Full Code Here

TOP

Related Classes of com.google.gwt.maeglin89273.game.ashinyballonthecross.client.core.creation.MainCreation

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.