moagg.model.object.sprite
Class Particle

java.lang.Object
  extended by com.golden.gamedev.object.Sprite
      extended by moagg.model.object.sprite.AbstractMoaggSprite
          extended by moagg.model.object.sprite.Particle
All Implemented Interfaces:
java.io.Serializable, MoaggGameObject

public class Particle
extends AbstractMoaggSprite
implements MoaggGameObject

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.golden.gamedev.object.Sprite
defaultCollisionShape, height, width
 
Constructor Summary
Particle()
           
 
Method Summary
 boolean isCollision()
           
 void render(java.awt.Graphics2D g)
          It turned out that this method must be overloaded to render particles "manually".
 void setCollision(boolean collision)
           
 void setGhost(boolean ghost)
           
 void setGradient(boolean gradient)
           
 void setLifeTime(long lifeTime)
           
 void update(long elapsedTime)
           
 
Methods inherited from class moagg.model.object.sprite.AbstractMoaggSprite
addSpeed, getPositionRectangle, getRGB, getSpeed, hide, isVisible, setRGB, setSpeed, setVisible, show
 
Methods inherited from class com.golden.gamedev.object.Sprite
addHorizontalSpeed, addVerticalSpeed, forceX, forceY, getBackground, getCenterX, getCenterY, getDataID, getDefaultCollisionShape, getDistance, getHeight, getHorizontalSpeed, getID, getImage, getLayer, getOldX, getOldY, getScreenX, getScreenY, getVerticalSpeed, getWidth, getX, getY, isActive, isImmutable, isOnScreen, isOnScreen, move, moveTo, moveX, moveY, render, setActive, setBackground, setDataID, setHorizontalSpeed, setID, setImage, 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
 

Constructor Detail

Particle

public Particle()
Method Detail

setGhost

public void setGhost(boolean ghost)

setCollision

public void setCollision(boolean collision)

isCollision

public boolean isCollision()

setGradient

public void setGradient(boolean gradient)

setLifeTime

public void setLifeTime(long lifeTime)

render

public void render(java.awt.Graphics2D g)
It turned out that this method must be overloaded to render particles "manually". If not (i.e. storing a white 1x1 BufferedImage in the Sprite), the performance impact is horrible when having hundreds of particles.

Overrides:
render in class com.golden.gamedev.object.Sprite

update

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


Copyright © 2008. All Rights Reserved.