com.wistrand.midlet.valentine
Class HeartSprite
java.lang.Object
|
+--com.wistrand.midlet.sprite.Sprite
|
+--com.wistrand.midlet.valentine.HeartSprite
- public class HeartSprite
- extends Sprite
Sprite which looks like a heart and moves in a nice way.
The heart will also create new BallonSprites and MultiStars
at random intervals.
Fields inherited from class com.wistrand.midlet.sprite.Sprite |
col, dx, dy, id, idCount, parent, px, py, rot, size, x, y |
Method Summary |
void |
moveTo(int x,
int y)
Move to a new coordinate. |
void |
paint(javax.microedition.lcdui.Graphics g)
Paint the sprite on a Graphics. |
void |
paintHeart(javax.microedition.lcdui.Graphics g,
int sx,
int sy,
int h)
Paint a heart at (sx, sy) with height h |
void |
setColor(int col)
|
void |
update()
Update position by adding speed to current pos. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
HeartSprite
public HeartSprite(SpriteCanvas canvas,
int x,
int y)
moveTo
public void moveTo(int x,
int y)
- Description copied from class:
Sprite
- Move to a new coordinate.
- Overrides:
moveTo
in class Sprite
setColor
public void setColor(int col)
- Overrides:
setColor
in class Sprite
update
public void update()
- Description copied from class:
Sprite
- Update position by adding speed to current pos.
- Overrides:
update
in class Sprite
paintHeart
public void paintHeart(javax.microedition.lcdui.Graphics g,
int sx,
int sy,
int h)
- Paint a heart at (sx, sy) with height h
paint
public void paint(javax.microedition.lcdui.Graphics g)
- Description copied from class:
Sprite
- Paint the sprite on a Graphics. Should be overridden
by subclasses since the default method does nothing.
- Overrides:
paint
in class Sprite