Advertisement
Guest User

Untitled

a guest
Oct 7th, 2015
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. public class SpaceShip extends Polygon {
  2.  
  3. //x and y coordinates
  4. public static int[] polyXArray = {...};
  5. public static int[] polyYArray = {...};
  6.  
  7. //other class variables
  8. {...}
  9.  
  10. public SpaceShip() {
  11.  
  12. super(polyXArray, polyYArray, polyXArray.length);
  13. }
  14. }
  15.  
  16. public abstract class GameShape extends Polygon {
  17.  
  18. //x and y coordinates, still unassigned
  19. public static int[] polyXArray, polyYArray;
  20.  
  21. //other class variables
  22. {...}
  23.  
  24. public GameShape() {
  25.  
  26. super(polyXArray, polyYArray, polyXArray.length);
  27. }
  28. }
  29.  
  30. public abstract class GameShape extends Polygon {
  31.  
  32. //x and y coordinates, still unassigned
  33. public int[] polyXArray, polyYArray;
  34.  
  35. //other class variables
  36. {...}
  37.  
  38. public GameShape() {
  39. instantiatePolyArrays();
  40. super(polyXArray, polyYArray, polyXArray.length);
  41. }
  42.  
  43. protected abstract void instantiatePolyArrays();
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement