Ejemplo n.º 1
0
 /** 动作处理(内部传参) */
 public void update(long elapsedTime) {
   if (timer.action(elapsedTime)) {
     if (isAnimation) {
       animation.update(elapsedTime);
       setImage(animation.getSpriteImage());
     }
     action(elapsedTime);
   }
 }
Ejemplo n.º 2
0
 public void setAnimation(Animation animation) {
   if (animation == null) {
     throw new RuntimeException("Animation is null !");
   }
   this.animation = animation;
   this.isAnimation = true;
   this.setImage(animation.getSpriteImage());
 }
Ejemplo n.º 3
0
 public void dispose() {
   if (image != null) {
     image.dispose();
     image = null;
   }
   if (animation != null) {
     animation.dispose();
     animation = null;
   }
 }
Ejemplo n.º 4
0
 public Actor(Animation animation, int x, int y) {
   if (animation == null) {
     throw new RuntimeException("Animation is null !");
   }
   this.noSequenceNumber = sequenceNumber++;
   this.animation = animation;
   this.isAnimation = true;
   this.location.set(x, y);
   this.setImage(animation.getSpriteImage());
 }