Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2011
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.98 KB | None | 0 0
  1. package pong;
  2.  
  3. import java.awt.Rectangle;
  4.  
  5. public class PongPlayer extends Thread{
  6.    
  7.     int x,y,width,height,speedY;
  8.     boolean up,down,paused;
  9.    
  10.     public PongPlayer(int x, int y, int width, int height){
  11.         this.x = x;
  12.         this.y = y;
  13.         this.width = width;
  14.         this.height = height;
  15.         speedY = 3;
  16.        
  17.         up = false;
  18.         down = false;
  19.        
  20.         paused = false;
  21.     }
  22.    
  23.     public int getX(){
  24.         return x;
  25.     }
  26.    
  27.     public int getY(){
  28.         return y;
  29.     }
  30.    
  31.     public int getWidth(){
  32.         return width;
  33.     }
  34.    
  35.     public int getHeight(){
  36.         return height;
  37.     }
  38.    
  39.     public int getSpeedY(){
  40.         return speedY;
  41.     }
  42.    
  43.     public void setX(int x){
  44.         this.x = x;
  45.     }
  46.    
  47.     public void setY(int y){
  48.         this.y = y;
  49.     }
  50.    
  51.     public void setWidth(int width){
  52.         this.width = width;
  53.     }
  54.    
  55.     public void setHeight(int height){
  56.         this.height = height;
  57.     }
  58.    
  59.     public void setSpeedY(int speedY){
  60.         this.speedY = speedY;
  61.     }
  62.    
  63.     public Rectangle getBounds(){
  64.         return new Rectangle(getX(),getY(),getWidth(),getHeight());
  65.     }
  66.  
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement