public class Bat
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private float |
batHeight |
private float |
batLength |
private PlayField |
playField |
private float |
speed |
private float |
x_as |
private float |
y_as |
| Constructor and Description |
|---|
Bat(PlayField playField)
Constructor The constructor takes the canvas as input, so it knows where it
lives and can ask the size of its canvas (borders)
|
| Modifier and Type | Method and Description |
|---|---|
void |
draw()
Draw the bat as a rectangle on the canvas
|
float |
getBatHeight()
Generated Getters & setters for the attributes
|
float |
getBatLength()
Generated Getters & setters for the attributes
|
float |
getX_as()
Generated Getters & setters for the attributes
|
float |
getY_as()
Generated Getters & setters for the attributes
|
void |
moveLeft()
Move the bat to the left; taking into account the speed of the bat; ánd the
wall
|
void |
moveRight()
Move the bat to the right; taking into account the speed of the bat; ánd the
wall
|
void |
setBatlength(float batLength)
Generated Getters & setters for the attributes
|
void |
setX_as(float x_as)
Generated Getters & setters for the attributes
|
private float batHeight
private float batLength
private PlayField playField
private float speed
private float x_as
private float y_as
public Bat(PlayField playField)
public void draw()
public float getBatHeight()
public float getBatLength()
public float getX_as()
public float getY_as()
public void moveLeft()
public void moveRight()
public void setBatlength(float batLength)
public void setX_as(float x_as)