public void Update(float delta) {
   if (KingsValley1.IsAndroid()) {
     this.explorer.setState(this.explorer.getIdleRight());
   }
   this.explorer.getCollisionRectJumpLeft().setX(this.explorer.getPosition().x + 10);
   super.Update(delta);
 }
 public void Update(float delta) {
   float x = this.explorer.getPosition().x - this.explorer.getSpeed();
   float y = (float) (this.a * Math.pow((x - this.h), 2d) + this.k);
   this.explorer.setPosition(new Vector2(x, y));
   if (ExplorerManager.CollisionDetectionGroundAfterJump()) {
     this.explorer.setPosition(
         new Vector2(
             x, this.explorer.getCollisionRectStairs().y + this.explorer.getPixelsThroughFloor()));
     if (KingsValley1.IsAndroid()) this.explorer.setState(this.explorer.getWalkLeft());
     else this.explorer.setState(this.explorer.getIdleLeft());
   }
   // base.Update(gameTime);
 }
예제 #3
0
 private IBuildingBlock LoadObject(char brickElement, int x, int y) {
   switch (brickElement) {
     case '.':
       return new Brick(this.game, new Vector2(x, y), this.region.get("brick_transparant"), '.');
     case '1':
       return new Brick(this.game, new Vector2(x, y), this.region.get("brick"), '1');
     case '2':
       return new Brick(this.game, new Vector2(x, y), this.region.get("fundament"), '2');
     case '3':
       return new Brick(this.game, new Vector2(x, y), this.region.get("emptySpace"), '3');
     case '+':
       float speed = (KingsValley1.IsAndroid()) ? 2f : 1.5f;
       this.explorer = new Explorer(this.game, new Vector2(x, y), speed);
       return new Brick(this.game, new Vector2(x, y), this.region.get("brick_transparant"), '+');
     case 's':
       return new StepRight(this.game, new Vector2(x, y), this.region.get("trapTopRight01"), 's');
     case 'x':
       return new StepLeft(this.game, new Vector2(x, y), this.region.get("trapTopLeft01"), 'x');
     default:
       return new Brick(this.game, new Vector2(x, y), this.region.get("Brick_transparant"), '.');
   }
 }