Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package game.pong;
- import java.awt.Color;
- import java.awt.Graphics;
- public class Player {
- private int y = Game.HEIGHT / 2;
- private int yVelocity = 0;
- public int score = 0;
- private int width = 15;
- private int height = 60;
- public Player(){
- }
- public void update(){
- y = y + yVelocity;
- System.out.println(y);
- }
- public void paint(Graphics g){
- g.setColor(Color.BLUE);
- g.fillRect(50, y, width, height);
- }
- public void setVelocity(int speed){
- yVelocity = speed;
- }
- public int getX() {
- return 15;
- }
- public int getY() {
- return y;
- }
- public int getWidth(){
- return width;
- }
- public int getHeight(){
- return height;
- }
- public int getScore(){
- return score;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement