Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. package Entities;
  2.  
  3. public class Bullet {
  4. int startPoint;
  5. int endPoint;
  6. int x;
  7. int y;
  8. int width;
  9. int height;
  10. int velocity;
  11.  
  12. public Bullet(int startPoint, int endPoint, int x, int y, int width, int height, int velocity) {
  13. this.startPoint = startPoint;
  14. this.endPoint = endPoint;
  15. this.width = width;
  16. this.height = height;
  17. this.velocity = velocity;
  18. }
  19.  
  20. public void shootBullet(Bullet bullet) {
  21. if(bullet.getStartPoint() != bullet.getEndPoint()) {
  22. bullet.setX(bullet.getX() * bullet.getVelocity());
  23. } else {
  24. bullet.setX(bullet.getEndPoint());
  25. }
  26. }
  27.  
  28. public int getVelocity() {
  29. return velocity;
  30. }
  31.  
  32. public void setVelocity(int velocity) {
  33. this.velocity = velocity;
  34. }
  35.  
  36. public int getX() {
  37. return x;
  38. }
  39.  
  40. public void setX(int x) {
  41. this.x = x;
  42. }
  43.  
  44. public int getY() {
  45. return y;
  46. }
  47.  
  48. public void setY(int y) {
  49. this.y = y;
  50. }
  51.  
  52.  
  53. public int getStartPoint() {
  54. return startPoint;
  55. }
  56.  
  57. public void setStartPoint(int startPoint) {
  58. this.startPoint = startPoint;
  59. }
  60.  
  61. public int getEndPoint() {
  62. return endPoint;
  63. }
  64.  
  65. public void setEndPoint(int endPoint) {
  66. this.endPoint = endPoint;
  67. }
  68.  
  69. public int getWidth() {
  70. return width;
  71. }
  72.  
  73. public void setWidth(int width) {
  74. this.width = width;
  75. }
  76.  
  77. public int getHeight() {
  78. return height;
  79. }
  80.  
  81. public void setHeight(int height) {
  82. this.height = height;
  83. }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement