Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pong;
- import java.awt.Rectangle;
- public class PongPlayer extends Thread{
- int x,y,width,height,speedY;
- boolean up,down,paused;
- public PongPlayer(int x, int y, int width, int height){
- this.x = x;
- this.y = y;
- this.width = width;
- this.height = height;
- speedY = 3;
- up = false;
- down = false;
- paused = false;
- }
- public int getX(){
- return x;
- }
- public int getY(){
- return y;
- }
- public int getWidth(){
- return width;
- }
- public int getHeight(){
- return height;
- }
- public int getSpeedY(){
- return speedY;
- }
- public void setX(int x){
- this.x = x;
- }
- public void setY(int y){
- this.y = y;
- }
- public void setWidth(int width){
- this.width = width;
- }
- public void setHeight(int height){
- this.height = height;
- }
- public void setSpeedY(int speedY){
- this.speedY = speedY;
- }
- public Rectangle getBounds(){
- return new Rectangle(getX(),getY(),getWidth(),getHeight());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement