Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Entities;
- public class Bullet {
- int startPoint;
- int endPoint;
- int x;
- int y;
- int width;
- int height;
- int velocity;
- public Bullet(int startPoint, int endPoint, int x, int y, int width, int height, int velocity) {
- this.startPoint = startPoint;
- this.endPoint = endPoint;
- this.width = width;
- this.height = height;
- this.velocity = velocity;
- }
- public void shootBullet(Bullet bullet) {
- if(bullet.getStartPoint() != bullet.getEndPoint()) {
- bullet.setX(bullet.getX() * bullet.getVelocity());
- } else {
- bullet.setX(bullet.getEndPoint());
- }
- }
- public int getVelocity() {
- return velocity;
- }
- public void setVelocity(int velocity) {
- this.velocity = velocity;
- }
- 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 getStartPoint() {
- return startPoint;
- }
- public void setStartPoint(int startPoint) {
- this.startPoint = startPoint;
- }
- public int getEndPoint() {
- return endPoint;
- }
- public void setEndPoint(int endPoint) {
- this.endPoint = endPoint;
- }
- 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;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement