public class Sprite
extends java.lang.Object
Constructor and Description |
---|
Sprite(java.lang.String name,
double position,
boolean facingRight)
Creates a new Sprite object of the specified name.
|
Modifier and Type | Method and Description |
---|---|
void |
announce(java.lang.String announcement)
This method makes the sprite announce themselves using the
specified announcment, and their name.
|
void |
attack()
Makes the character draw their sword, attack once, and put their sword away.
|
void |
jump()
Makes the character jump a short distance
|
void |
move(java.lang.String direction)
The parameter can only be either "left" or "right".
|
public Sprite(java.lang.String name, double position, boolean facingRight)
public void announce(java.lang.String announcement)
announcement
- the text to saypublic void attack()
public void jump()
public void move(java.lang.String direction)