java.lang.ObjectBar
public class Bar
| Constructor Summary | |
|---|---|
Bar(int y)
Constructor below takes in the y location of where the bar should be The x should be random The size should be random The direction (left or right should be random |
|
| Method Summary | |
|---|---|
void |
draw(java.awt.Graphics g)
This will draw the bar on g |
boolean |
isCollision(int squareX,
int squareY)
Hard method use your example of collissions from before |
void |
move()
Have the bar move left or right depending on direction |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Bar(int y)
| Method Detail |
|---|
public void draw(java.awt.Graphics g)
public boolean isCollision(int squareX,
int squareY)
public void move()