示例#1
0
 public Player(
     Image[] framesRight,
     Image[] framesLeft,
     Image[] jumpFrames,
     Image[] deadFrames,
     BasicGame game) {
   this.animationRunRight = new Animation(framesRight, 100);
   this.animationRunLeft = new Animation(framesLeft, 100);
   this.animationJump = new Animation(jumpFrames, 75);
   this.animationDead = new Animation(deadFrames, 75);
   border =
       new Circle(
           x + animationRunRight.getWidth() / 2,
           y + animationRunRight.getHeight() / 2,
           animationRunRight.getWidth() / 2);
   isOnLeftSide = true;
   isAlive = true;
   this.game = game;
 }
示例#2
0
  public Player(
      SpriteSheet runSheetLeft,
      SpriteSheet runSheetRight,
      SpriteSheet deadSheet,
      SpriteSheet jumpSheet,
      BasicGame game) {
    this.animationRunLeft = new Animation(runSheetLeft, 100);
    this.animationRunRight = new Animation(runSheetRight, 100);
    this.animationJump = new Animation(jumpSheet, 75);
    this.animationDead = new Animation(deadSheet, 150);
    this.animationDead.setLooping(false);
    this.animationDead.setCurrentFrame(0);

    border =
        new Circle(
            x + animationRunRight.getWidth() / 2,
            y + animationRunRight.getHeight() / 2,
            animationRunRight.getWidth() / 2);
    isOnLeftSide = true;
    isAlive = true;

    this.game = game;
  }