Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Paddle extends Block{
- private int speed;
- public Paddle(){
- super(10,10,10,10);
- speed =5;
- }
- //add other Paddle constructors
- //add accessor method for speed
- //add mutator method for speed
- //add equals method
- //add toString method
- public void moveUpAndDisplay(){
- //first, draw over the paddle with white
- //using the inherited display(color col)
- display(color(255));
- //then update the y location
- setY(getY() - speed);
- //then display in new location
- display();
- }
- public void moveDownAndDisplay(){
- //similar to above
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement