Skip to content

Instantly share code, notes, and snippets.

@technoAl
Created March 1, 2021 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save technoAl/f69d84708acb2e0cc6a70b347f4c3641 to your computer and use it in GitHub Desktop.
Save technoAl/f69d84708acb2e0cc6a70b347f4c3641 to your computer and use it in GitHub Desktop.
public class Player {
private int x, y, width, height;
private int score = 0, velocityY = 0;
public Player(int x, int y, int width, int height){
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
public void increaseScore(){
score++;
}
public int getX() {
return x;
}
public void setX(int x) {
this.x = x;
}
public int getY() {
return y;
}
public void setY(int y) {
this.y = y;
}
public int getWidth() {
return width;
}
public void setWidth(int width) {
this.width = width;
}
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
public int getScore() {
return score;
}
public void setScore(int score) {
this.score = score;
}
public int getVelocityY() {
return velocityY;
}
public void setVelocityY(int velocityY) {
this.velocityY = velocityY;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment