Genuts API

com.genuts.gameui
Class MovingSpriteWrapper

java.lang.Object
  |
  +--com.genuts.gameui.Sprite
        |
        +--com.genuts.gameui.SpriteWrapper
              |
              +--com.genuts.gameui.MovingSpriteWrapper
All Implemented Interfaces:
Tickable
Direct Known Subclasses:
MovingPrecisionSpriteWrapper

public abstract class MovingSpriteWrapper
extends SpriteWrapper

Sprite wrapper with the ability to move.

This sprite wrapper is an abstract class, it can only be extended directly to define its own behavior for moving.


Constructor Summary
MovingSpriteWrapper(Sprite sprite)
          Initializes the moving sprite with an action sprite.
 
Method Summary
abstract  void move(int ticks)
          Moves the sprite as desired.
 void tick(int ticks)
          Commands to delagate the moving action to move(int).
 
Methods inherited from class com.genuts.gameui.SpriteWrapper
checkCollision, collisionWith, getActionSprite, getBackground, getBottomCollisionOffset, getBounds, getFinalActionSprite, getHeight, getId, getImage, getLeftCollisionOffset, getParent, getPosition, getRightCollisionOffset, getSize, getTopCollisionOffset, getWidth, getX, getY, invalidate, isBackgroundSprite, isPremode, isSpriteAt, isValidate, isVisible, paint, preCollisionWith, repaint, setActionSprite, setBackground, setBackgroundSprite, setBottomCollisionOffset, setBounds, setBounds, setId, setImage, setLeftCollisionOffset, setParent, setPosition, setPremode, setRightCollisionOffset, setSize, setTopCollisionOffset, setVisible, validate
 
Methods inherited from class com.genuts.gameui.Sprite
getFinalWrapper, getWrapper, setWrapper, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MovingSpriteWrapper

public MovingSpriteWrapper(Sprite sprite)
Initializes the moving sprite with an action sprite.

Parameters:
sprite - Sprite for visualisation.
Method Detail

move

public abstract void move(int ticks)
Moves the sprite as desired.

Parameters:
ticks - Number of ticks from the playfield

tick

public void tick(int ticks)
Commands to delagate the moving action to move(int).

Specified by:
tick in interface Tickable
Overrides:
tick in class SpriteWrapper
Parameters:
ticks - Number of ticks from the playfield

Genuts API

Genuts API