Advertisement
RecklessDarph

Mogellijke andere juiste Mazub

Jul 10th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.41 KB | None | 0 0
  1. package jumpingalien.model;
  2.  
  3. import jumpingalien.util.ModelException;
  4. import jumpingalien.util.Sprite;
  5.  
  6. import static org.junit.Assert.assertNotEquals;
  7.  
  8. import java.math.BigDecimal;
  9. import java.math.RoundingMode;
  10. import be.kuleuven.cs.som.annotate.*;
  11.  
  12.  
  13.  
  14. public class Mazub{
  15. /*
  16. **************
  17. * Game World *
  18. **************test
  19. */
  20. private double World_Width= 1024/100;
  21. private double World_Height=768/100;
  22.  
  23. /*
  24. ************
  25. * Position *
  26. ************
  27. */
  28. //Variables
  29. private double[] ActualPositon;
  30. private int[] PixelPosition;
  31.  
  32. //facade
  33. public double[] getActualPosition() {
  34. return ActualPositon;
  35. }
  36.  
  37. public void changeActualPosition(double[] newPosition) throws Exception {
  38. if(newPosition[1] <0 || newPosition[0] <0) {throw new Exception("A or both positions are negative");}
  39. if(Double.isNaN(newPosition[0]) ||Double.isNaN(newPosition[1])) {throw new Exception("Invalid input type");}
  40. else if(newPosition.length != 2) {throw new Exception("Invalid size of Position");}
  41. this.ActualPositon = newPosition;
  42.  
  43. }
  44.  
  45. // Helper classes
  46. public int[] getPixelPosition() {
  47. int[] newPixelPosition= {(int) (getActualPosition()[0]*100),(int) (getActualPosition()[1]*100)};
  48. return newPixelPosition ;}
  49.  
  50. public void setActualPositon(double x, double y) throws Exception {
  51. if(x < 0 || y<0) {throw new Exception("A or both positions are negative");}
  52. else if(Double.isNaN(x) ||Double.isNaN(y)) {throw new Exception("Invalid input type");}
  53. double[] actualPositon= {x,y}; ActualPositon = actualPositon;
  54. }
  55.  
  56. public void setPixelPosition(int x, int y) throws Exception {
  57. if(x <0 || y <0) {throw new Exception("A or both positions are negative");}
  58. else{
  59. int[] newPositon= {x,y};
  60. PixelPosition = newPositon;}
  61. }
  62. //helper methods
  63.  
  64. /*
  65. ***********
  66. * Mazub *
  67. ***********
  68. */
  69. public Mazub(int pixelLeftX, int pixelBottomY, Sprite... sprites) throws Exception {
  70. setActualPositon((double)pixelLeftX/100, (double)pixelBottomY/100);
  71. setAllSprites(sprites);
  72. }
  73.  
  74. /*
  75. **************
  76. * Orientation*
  77. **************
  78. */
  79. //variable
  80. private int Orientation=0;
  81. //facade
  82. public int getOrientation() {
  83. return Orientation;
  84. }
  85. //helper methods
  86. public void setOrientation(int currentOrientation) {
  87. this.Orientation = currentOrientation;
  88. }
  89.  
  90. /*
  91. ************
  92. * Velocity *
  93. ************
  94. */
  95.  
  96. //variable
  97. public double[] Velocity = {0,0};
  98. //variables
  99. private double Max_Horizontal = 3.0;
  100. private double Min_Horizontal = 1.0;
  101. //facade
  102. public double[] getVelocity() {
  103. return this.Velocity;
  104. }
  105. // helpermethodes
  106. public void setVelocity(double x, double y) {
  107. double[] velocity= {x,y};
  108. Velocity = velocity;
  109. }
  110.  
  111. //helper methods
  112. public double getMax_Horizontal() {
  113. if(getVelocity()[0]>0) {return Max_Horizontal;}
  114. if(getVelocity()[0]<0) {return Max_Horizontal*-1;}
  115. else {return Max_Horizontal;}
  116. }
  117. public void setMax_Horizontal(double max_Horizontal) {
  118. Max_Horizontal = max_Horizontal;
  119. }
  120.  
  121. /*
  122. ****************
  123. * Acceleration *
  124. ****************
  125. */
  126. /* Acceleration *//* not sure*/
  127. //variable
  128. public double[] Acceleration = {0,0};
  129. //facade
  130. public double[] getAcceleration() {
  131. return this.Acceleration;
  132. }
  133. //not in facade
  134. public void setAcceleration(double x, double y) {
  135. double[] acceleration= {x,y};
  136. Acceleration = acceleration;
  137. }
  138.  
  139. /*
  140. **********************
  141. * Horizontal Vertical*
  142. **********************
  143. */
  144. /**
  145. * Method that sets the right velocity and acceleration for moving mazub.
  146. * @param dt
  147. * Time to be used when changing the position of mazub.
  148. * @effect if the absolute value of het horizontla velocity is less than the maximal horizontal velocity
  149. * |if(Math.abs(getVelocity()[0])<Math.abs(getMAXIMUM_HORIZONTAL_SPEED()))
  150. * |then (setVelocity( velocity.add(acceleration.multiply(time)).doubleValue(), getVelocity()[1]))
  151. * @effect if the horizontal velocity is equal to zero and the absolute value of the horizontal velocity is less than the absolute value of the maximal horizontal speed
  152. * |if(getVelocity()[0]!=0 && Math.abs(getVelocity()[0])> Math.abs(getMAXIMUM_HORIZONTAL_SPEED()))
  153. * |then (setVelocity(getMAXIMUM_HORIZONTAL_SPEED(), getVelocity()[1]))
  154. * @effect if the horizontal velocity is equal to zero and the absolute value of the horizontal velocity is less than the absolute value of the minimal horizontal speed
  155. * |if(getVelocity()[0]!=0 && Math.abs(getVelocity()[0])<Math.abs(getMINIMAL_HORIZONTAL_SPEED()))
  156. * |then (setVelocity(getMINIMAL_HORIZONTAL_SPEED(), getVelocity()[1]);)
  157. *
  158. */
  159. public void horizontalMaxChanging(double dt) {
  160. if(Math.abs(getVelocity()[0])<Math.abs(getMax_Horizontal())){setVelocity( getVelocity()[0]+getAcceleration()[0]*dt, getVelocity()[1]);}
  161. if(getVelocity()[0]!=0 && Math.abs(getVelocity()[0])> Math.abs(getMax_Horizontal())) {setVelocity(getMax_Horizontal(), getVelocity()[1]);}
  162.  
  163. }
  164.  
  165.  
  166.  
  167. /*
  168. **********************
  169. * Vertical Vertical*
  170. **********************
  171. */
  172. /**
  173. * Sets the new actual position of mazub.
  174. * @param dt
  175. * Time to be used when changing the position of mazub.
  176. * @effect if the world is not equal to null and the current actual position of mazub is less than zero
  177. * |if(getWorld() != null && getActualPosition()[1]<=0)
  178. * |then (setAcceleration(getAcceleration()[0],0);)
  179. * @post the new vertical acceleration of mazub is set to 0
  180. * |new.getAcceleration()[1]==0;
  181. * @post The new vertical velocity of mazub is set to velocity.add(acceleration.multiply(time)).doubleValue()
  182. * |new.getVelocity()[1]==velocity.add(acceleration.multiply(time)).doubleValue();
  183. */
  184. public void verticalChanging(double dt) {
  185. setVelocity(getVelocity()[0], getVelocity()[1]+getAcceleration()[1]*dt);
  186. if(getActualPosition()[1]<=0) {setAcceleration(getAcceleration()[0],0);}
  187.  
  188. }
  189.  
  190. /*
  191. **********
  192. * Running*
  193. **********
  194. */
  195. /**
  196. * Sets the right orientation, acceleration and velocity of mazub to move to the left.
  197. * @throws Exception
  198. * @post new orientation is set to -1
  199. * |new.getOrientation==-1
  200. * @post new horizontal acceleration is set to -0.9
  201. * |new.getAcceleration()[0]==-0.9
  202. * @post new horizontal velocity is set to -1
  203. * |new.getVelocity()[0]==-1
  204. * @post Moving is set to true
  205. * |new.IsMoving()==true
  206. */
  207. public void startMoveLeft() throws Exception {
  208. if(isMoving()==false) {
  209. setOrientation(-1);
  210. setAcceleration(-0.9, getAcceleration()[1]);
  211. setVelocity(-1, getVelocity()[1]);
  212.  
  213. }
  214. else {
  215. throw new Exception("Already moving");
  216. }
  217. }
  218.  
  219.  
  220. public void startMoveRight() throws Exception {
  221. if(isMoving()==false) {
  222. setOrientation(1);
  223. setAcceleration(0.9, getAcceleration()[1]);
  224. setVelocity(1, getVelocity()[1]);
  225. }
  226. else {
  227. throw new Exception("Already moving");
  228. }
  229. }
  230.  
  231. /**
  232. * Set to true if mazub is moving. Else to false
  233.  
  234. public void startMoveRight() {
  235. int px=getPixelPosition()[0]; int py=getPixelPosition()[1];
  236. setOrientation(1);
  237. setAcceleration(0.9, getAcceleration()[1]);
  238. setVelocity(1, getVelocity()[1]);
  239.  
  240. /**
  241. * End the horizontal movement of mazub.
  242. * @throws Exception
  243. * @post The current orientation is equal to 0
  244. * | new.getOrientation() == 0
  245. * @post The current horizontal acceleration is equal to 0
  246. * | new.getAcceleration()[0]==0
  247. * @post The horizontal velocity is equal to 0
  248. * | new.getVelocity()[0]==0
  249. */
  250. public void endMove() throws Exception {
  251. if(isMoving()==true) {
  252. setAcceleration(0, getAcceleration()[1]);
  253. setVelocity(0, getVelocity()[1]);
  254. }
  255. else {
  256. throw new Exception("Not moving");
  257. }
  258.  
  259. }
  260.  
  261.  
  262. /**
  263. *
  264. * @return the value of the variable Moving
  265. * if mazub is moving
  266. * | result == if(Moving)
  267. * |then (return true;)
  268. * |else (return false;)
  269. *
  270. */
  271. public boolean isMoving() {
  272. if(getVelocity()[0]!=0) {return true;}
  273. else {return false;}
  274. }
  275.  
  276. /**
  277. * Initialize this new Mazub with given time.
  278. *
  279. * @param time
  280. * The time for this new Mazub.
  281. * @pre This new Mazub can have the given time as its time.
  282. * | canHaveAstime(time)
  283. * @post The time of this new Mazub is equal to the given
  284. * time.
  285. * | new.gettime() == time
  286. */
  287.  
  288. /**
  289. * Sets the new actual position of mazub
  290. * @param time
  291. * time to us to calculate the new position
  292. * @throws Exception
  293. * @effect if the horizontal actual position is equal or greater than zero and is smaller or equal to the world world dimentions
  294. * |if(getActualPosition()[0] >= 0 && getActualPosition()[0] <= getDimentions()[0])
  295. * |then(double posx=
  296. * BigDecimal.valueOf(actualPosition[0])
  297. * .add (BigDecimal.valueOf(Velocity[0]).multiply(BigDecimal.valueOf(time)))
  298. * .add(BigDecimal.valueOf(getAcceleration()[0]).multiply(BigDecimal.valueOf(0.5))
  299. * .multiply(BigDecimal.valueOf(Math.pow(time, 2)))).doubleValue();)
  300. * @effect if the horizontal actual postion is greater than the horizontal dimention of the world
  301. * |if(getActualPosition()[0]>getDimentions()[0])
  302. * | then setActualPosition(getDimentions()[0],getActualPosition()[1])
  303. * @effect if the horizontal actual postion is less than the horizontal dimention of the world
  304. * |if(getActualPosition()[0]< 0)
  305. * |then (setHitPoint(0);)
  306. *
  307. */
  308. public void running(double time) throws Exception {
  309. if(getActualPosition()[0] >= 0 && getActualPosition()[0] < World_Width) {
  310. double posx=getActualPosition()[0]+getVelocity()[0]*time+getAcceleration()[0]*0.5*time*time;
  311.  
  312. setActualPositon(posx, getActualPosition()[1]);
  313. }
  314. }
  315.  
  316.  
  317.  
  318.  
  319. /*
  320. *********************
  321. * Jumping & Falling *
  322. *********************
  323. */
  324. /**
  325. * Is true if mazub is jumping. Else is false
  326. */
  327. public boolean jumping;
  328. /**
  329. * The acceleration of mazub while jumping
  330. */
  331. public double ACCELERATION_WHILE_JUMPING = 8.0;
  332. /**
  333. * The acceleration of mazub while falling
  334. */
  335. public double ACCELERATION_WHILE_FALLING = -10.0;
  336.  
  337. /**
  338. * Set the vertical velocity of this object_name to the given vertical velocity.
  339. * @throws Exception
  340. *
  341. * @pre The given vertical velocity must be a valid vertical velocity for any
  342. * Mazub.
  343. * | isValidVERTICAL_VELOCITY(setVetical_VELOCITY(ACCELERATION_WHILE_JUMPINT))
  344. * @post The vertical velocity of this Mazub is equal to the given
  345. * vertical velocity.
  346. * | new.getVERTICAL_VELOCITY() == setVetical_VELOCITY(ACCELERATION_WHILE_JUMPINT)
  347. * @post The vertical acceleration of this Mazub is equal to -10.
  348. * | new.getAcceleration()[1] == setVetical_ACCELERATION(-10)
  349. * @post
  350. * |new.IsJumping()==true
  351. *
  352. */
  353. public void startJump() throws Exception {
  354. if(isJumping()==false) {
  355. setVelocity(getVelocity()[0], ACCELERATION_WHILE_JUMPING);
  356. setAcceleration(getAcceleration()[0], ACCELERATION_WHILE_FALLING);
  357. }
  358. else {
  359. throw new Exception("Already Jumping");
  360. }
  361. }
  362.  
  363.  
  364. public void endJump() throws Exception {
  365. if(isJumping()) {
  366. falling();
  367. if(getVelocity()[1]>0) {setVelocity(getVelocity()[0],0);}
  368. }
  369. else {
  370. throw new Exception("Not Jumping");
  371. }
  372. }
  373.  
  374. public void falling() {
  375. setAcceleration(getAcceleration()[0], ACCELERATION_WHILE_FALLING);
  376. }
  377.  
  378.  
  379. public boolean isJumping() {
  380. if(getVelocity()[1]!=0) {return true;}
  381. else{return false;}
  382. }
  383.  
  384. /**
  385. * Check whether the given time is a valid time for any Mazub.
  386. *
  387. * @param time
  388. * The time to check.
  389. * @return
  390. * | if (time == 0.2)
  391. * |then (return true)
  392. * |else (result== false)
  393. */
  394. public static boolean isValidtime(double time) {
  395. if (time == 0.2) {return true;}
  396. else {return false;}
  397. }
  398.  
  399.  
  400. public void jumping(double time) throws Exception{
  401. if(getActualPosition()[1] >= 0 && getActualPosition()[1] <World_Height) {
  402. double posy= getActualPosition()[1]+getVelocity()[1]*time+getAcceleration()[1]*0.5*time*time;
  403. if(posy <0) {posy=0;}if(posy >World_Height) {posy=World_Height-1;}
  404. setActualPositon(getActualPosition()[0], posy);
  405. }
  406. if(getActualPosition()[1]<=0) {setAcceleration(getAcceleration()[0],0);setVelocity(getVelocity()[0], 0);}
  407.  
  408. }
  409.  
  410.  
  411. /*
  412. ***********
  413. * Ducking *
  414. ***********
  415. */
  416.  
  417.  
  418. public void startDuck() throws Exception {
  419.  
  420. setMax_Horizontal(1.0);setAcceleration(0, getAcceleration()[1]);
  421.  
  422. }
  423.  
  424. public void endDuck() throws Exception {
  425.  
  426. setMax_Horizontal(3.0);
  427.  
  428. }
  429.  
  430. /**
  431. *
  432. * @return true is mazub is ducking. False if not
  433. * |if(Ducking)
  434. * |(result==true)
  435. * |else (result == false)
  436. */
  437. public boolean isDucking() {
  438. if(Math.abs(getMax_Horizontal())==1.0) {return true;}
  439. else {return false;}
  440. }
  441.  
  442.  
  443. /*
  444. ****************
  445. * AdvancedTime *
  446. ****************
  447. */
  448. //Time
  449. public double aFitfhOFASecond = 0;
  450. public double milisecond= 0;
  451. public double HitTime=0;
  452.  
  453.  
  454. public boolean test;
  455. public double lessThenaSecond=0.000;
  456. public void advanceTime(double time) throws Exception {
  457. if(Double.isNaN(time)) {time=0;}
  458.  
  459.  
  460. running(time);
  461. jumping(time);
  462. horizontalMaxChanging(time);
  463. verticalChanging(time);
  464.  
  465. if(lessThenaSecond>=1.00 && isMoving()==false) {setOrientation(0);lessThenaSecond =0;}
  466. if(isMoving()==false) {lessThenaSecond +=time;}
  467.  
  468. if (isMoving() && milisecond >= 0.075) {setImagCount(getImagCount()+ 1); milisecond -= 0.075;}
  469. else {milisecond += time;}
  470.  
  471. if(isMoving() == false) {setImagCount(0);}
  472.  
  473.  
  474. }
  475.  
  476.  
  477. /*
  478. ****************
  479. * Sprites *
  480. ****************
  481. */
  482.  
  483. int[] SpriteDimentions=new int[2];
  484.  
  485. /**
  486. * returns the dimention of the current sprites
  487. * @effect..
  488. * new.getSpriteDimentions[0]==70
  489. * If is not ducking, not moving and not jumping or is jumping or moving
  490. * |if(!(isMoving()) && !(isDucking()) && !(isJumping()) || (isJumping()|| isMoving()))
  491. * |then (this.SpriteDimentions[1]=97;)
  492. * If mazub is ducking
  493. * |if(isDucking())
  494. * |then (this.SpriteDimentions[1]=70;)
  495. * @return..
  496. * |result==SpritDimentions
  497. */
  498. public int[] getSpriteDimention() {
  499.  
  500. if(!(isMoving()) && !(isDucking()) && !(isJumping()) || (isJumping()|| isMoving())) {this.SpriteDimentions[1]=97;}
  501. if(isDucking()) {this.SpriteDimentions[1]=70;}
  502. SpriteDimentions[0]=70;
  503. return SpriteDimentions;
  504. }
  505.  
  506.  
  507.  
  508. /**
  509. * Used to know what index of Sprites to use next while mazub is running
  510. */
  511. public int imagCount;
  512. private Sprite[] Allsprites;
  513. // /**
  514. // * Sets the sprites for Mazub
  515. // * @param sPRITES
  516. // * @post ...
  517. // * |SPRITES = sPRITES
  518. // * @throws IllegalArgumentExecption if array of sprytes is empty.
  519. // * |if(sPRITES==null) {throw new IllegalArgumentException();}
  520. // */
  521.  
  522. /**
  523. * Sets the image Count of the sprites for Mazub
  524. * @param imagCount
  525. * @post ..
  526. * |new.imagCount = imagCount
  527. */
  528. public void setImagCount(int imagCount){
  529. this.imagCount = imagCount;}
  530.  
  531. /**
  532. * Gets the image Count of the sprites for Mazub
  533. * @return...
  534. * |result==imagCount
  535. */
  536. public int getImagCount() {return imagCount;}
  537.  
  538. /**
  539. * Gets the current sprite for Mazub while it is moving.
  540. * @effect...
  541. * |if((isDucking() == false)&&(getOrientation() ==0) && (getOrientation() == 0)) {return getSprites()[0];}
  542. * |else if((isDucking() == true) && (getOrientation()==0) &&(getOrientation() == 0)) {return getSprites()[1];
  543. * |else if((getOrientation() > 0) && (Moving == false) && (isDucking() == false)) {return getSprites()[2];}
  544. * |else if((getOrientation() < 0) && (Moving == false)&& (isDucking() == false)) {return getSprites()[3];}
  545. * |else if((getOrientation() == 1) && (isDucking() ==false) && (isJumping() == true)) {return getSprites()[4];}
  546. * |else if((getOrientation() ==-1) && (isDucking() == false)&& (isJumping() == true)) {return getSprites()[5];}
  547. * |else if((getOrientation() ==1||getOrientation() == 1) && (isDucking() == true)) {return getSprites()[6];}
  548. * |else if((getOrientation() == -1|| getOrientation() == -1) &&(isDucking() ==true)) {return getSprites()[7];}
  549. * |else if((getOrientation() == 1) && (isDucking() == false)&& (isJumping() == false)) {return getSprites()[8+setImages()];}
  550. * |else if((getOrientation() == -1) && (isDucking()== false)&& (isJumping() ==false)) {return getSprites()[((SPRITES.length-8)/2+8)+(setImages())];}
  551. * |else {return getSprites()[1];}
  552. * @return
  553. * |result==getSprites()
  554. */
  555. public Sprite getCurrentSprite() {
  556. /*
  557. * if(isMoving()==false) { if(isDucking()) {} if(isDucking()==false) { if
  558. * (getOrientation()==0) {} if (getOrientation()==1) {} if(getOrientation()==-1)
  559. * {} }
  560. *
  561. * } if (isMoving()==true) { if(isJumping()) {
  562. *
  563. * } if(isJumping()==false) {
  564. *
  565. * } } else {
  566. *
  567. *
  568. * }
  569. */
  570.  
  571.  
  572. //0 is not moving horizontally, has not moved horizontally within the last second of in-game time and is not ducking.
  573. if(getOrientation()==0&&(isDucking() == false)&&(getVelocity()[0]==0)) {return getSprites()[0];}
  574. //1 is not moving horizontally, has not moved horizontally within the last second of in-game time and is ducking.
  575. else if ((isDucking() == true) && (getOrientation()==0) &&(getVelocity()[0])==0) {return getSprites()[1];}
  576.  
  577. //2 is not moving horizontally but its last horizontal movement was to the right (within 1s), and the character is not ducking.
  578. //Looking at right
  579. else if (getOrientation() ==1 && isMoving()==false && (isDucking() == false)) {return getSprites()[2];}
  580. //3 is not moving horizontally but its last horizontal movement was to the left (within 1s), and the character is not ducking.
  581. //Looking at left
  582. else if (getOrientation()==-1 && (isMoving()==false)&& (isDucking() == false)) {return getSprites()[3];}
  583.  
  584. //4 is moving to the right and jumping and not ducking.
  585. //Jumping right
  586. else if (getVelocity()[0]>0 && (isDucking() ==false) && (isJumping() == true)) {return getSprites()[4];}
  587. //5 is moving to the left and jumping and not ducking.
  588. else if (getVelocity()[0]<0 && (isDucking() == false)&& (isJumping() == true)) {return getSprites()[5];}
  589. //8..(8 + m) the character is neither ducking nor jumping and moving to the right
  590. else if (getVelocity()[0]>0 && (isDucking() == false)&& (isJumping() == false)) {return getSprites()[8+setImages()];}
  591.  
  592. //(9 + m)..(9 + 2m) the character is neither ducking nor jumping and moving to the left.
  593. else if (getVelocity()[0]<0 && (isDucking()== false)&& (isJumping() ==false)) {return getSprites()[((getSprites().length-8)/2+8)+(setImages())];}
  594.  
  595. //6 is ducking and moving to the right or was moving to the right (within 1s)
  596. else if ((isDucking() == true) && getVelocity()[0]>0||getOrientation()>0 ) {return getSprites()[6];}
  597. //7 is ducking and moving to the left or was moving to the left (within 1s).
  598. else if (getVelocity()[0]<0||getOrientation()<0 &&(isDucking() ==true)) {return getSprites()[7];}
  599.  
  600. else {return getSprites()[0];}
  601. }
  602.  
  603. /**
  604. * Sets the images of Mazub
  605. * @post...
  606. * |new.length=(getSprites().length-8)/2;
  607. * |new.m1 = getImagCount();
  608. * @return ...
  609. * |result==m1
  610. * @effect if the imagecount exceeds the length of the sprites array
  611. * |if(getImagCount() >= length)
  612. * |then (setImagCount(0))
  613. */
  614. public int setImages() {
  615. int length=(getSprites().length-8)/2;
  616. if(getImagCount() >= length) {setImagCount(0);}
  617. int m1 = getImagCount();
  618. return m1;
  619. }
  620.  
  621.  
  622. private void setAllSprites(Sprite[] sprites) throws Exception {
  623. if(sprites.length <10 ||sprites.length%2 ==1) {throw new Exception("Invalid sprites");}
  624. for (int i = 0; i < sprites.length; i++) {
  625. if(sprites[i]==null || sprites[i] instanceof Sprite==false) {
  626. throw new Exception("Illegal type sprites");}
  627. }
  628.  
  629. this.Allsprites = sprites.clone();
  630. }
  631. //helper methods
  632.  
  633. public Sprite[] getSprites() {
  634. return this.Allsprites.clone();
  635. }
  636.  
  637.  
  638. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement