moagg.model.object.sprite
Class Magnet

java.lang.Object
  extended by com.golden.gamedev.object.Sprite
      extended by com.golden.gamedev.object.AnimatedSprite
          extended by moagg.model.object.sprite.AbstractMoaggAnimatedSprite
              extended by moagg.model.object.sprite.Magnet
All Implemented Interfaces:
java.io.Serializable, ActivatableObject, MoaggGameObject, OrientationObject

public class Magnet
extends AbstractMoaggAnimatedSprite
implements MoaggGameObject, OrientationObject, ActivatableObject

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.golden.gamedev.object.Sprite
defaultCollisionShape, height, width
 
Constructor Summary
Magnet()
           
 
Method Summary
 void activate()
          Calling this method activates this object.
 void deactivate()
          Calling this method deactivates this object.
 int getDistance()
           
 Orientation getOrientation()
           
 int getStrength()
           
 boolean isActivated()
           
 void setActivatable(Activatable activatable)
           
 void setDistance(int distance)
           
 void setOrientation(Orientation orientation)
           
protected  void setState(moagg.model.object.sprite.Magnet.State state)
           
 void setStrength(int strength)
           
 void toggle()
          Calling this method toggles the object state between activated and deactivated.
 void update(long elapsedTime)
           
 
Methods inherited from class moagg.model.object.sprite.AbstractMoaggAnimatedSprite
addSpeed, getPositionRectangle, getRGB, getSpeed, hide, isVisible, setRGB, setSpeed, setVisible, show
 
Methods inherited from class com.golden.gamedev.object.AnimatedSprite
getAnimationTimer, getFinishAnimationFrame, getFrame, getImage, getImage, getImages, getStartAnimationFrame, isAnimate, isLoopAnim, render, setAnimate, setAnimationFrame, setAnimationTimer, setFrame, setImage, setImages, setLoopAnim, updateAnimation
 
Methods inherited from class com.golden.gamedev.object.Sprite
addHorizontalSpeed, addVerticalSpeed, forceX, forceY, getBackground, getCenterX, getCenterY, getDataID, getDefaultCollisionShape, getDistance, getHeight, getHorizontalSpeed, getID, getLayer, getOldX, getOldY, getScreenX, getScreenY, getVerticalSpeed, getWidth, getX, getY, isActive, isImmutable, isOnScreen, isOnScreen, move, moveTo, moveX, moveY, render, setActive, setBackground, setDataID, setHorizontalSpeed, setID, setImmutable, setLayer, setLocation, setMovement, setSpeed, setVerticalSpeed, setX, setY, updateMovement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface moagg.model.object.MoaggGameObject
getHeight, getID, getPositionRectangle, getSpeed, getWidth, getX, getY, hide, isVisible, setID, setSpeed, setSpeed, setX, setY, show
 
Methods inherited from interface moagg.model.object.MoaggGameObject
getHeight, getID, getPositionRectangle, getSpeed, getWidth, getX, getY, hide, isVisible, setID, setSpeed, setSpeed, setX, setY, show
 
Methods inherited from interface moagg.model.object.MoaggGameObject
getHeight, getID, getPositionRectangle, getSpeed, getWidth, getX, getY, hide, isVisible, setID, setSpeed, setSpeed, setX, setY, show
 

Constructor Detail

Magnet

public Magnet()
Method Detail

setActivatable

public void setActivatable(Activatable activatable)

isActivated

public boolean isActivated()
Specified by:
isActivated in interface ActivatableObject
Returns:
true, if the object's current state is activated, else false.

activate

public void activate()
Description copied from interface: ActivatableObject
Calling this method activates this object.

Specified by:
activate in interface ActivatableObject

deactivate

public void deactivate()
Description copied from interface: ActivatableObject
Calling this method deactivates this object.

Specified by:
deactivate in interface ActivatableObject

toggle

public void toggle()
Description copied from interface: ActivatableObject
Calling this method toggles the object state between activated and deactivated.

Specified by:
toggle in interface ActivatableObject

getOrientation

public Orientation getOrientation()
Specified by:
getOrientation in interface OrientationObject

setOrientation

public void setOrientation(Orientation orientation)

getStrength

public int getStrength()

setStrength

public void setStrength(int strength)

getDistance

public int getDistance()

setDistance

public void setDistance(int distance)

setState

protected void setState(moagg.model.object.sprite.Magnet.State state)

update

public void update(long elapsedTime)
Overrides:
update in class com.golden.gamedev.object.AnimatedSprite


Copyright © 2008. All Rights Reserved.