Guest User

Untitled

a guest
Jan 22nd, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. /**
  2. * Creates a basic Brick object at a specified position. The new Brick will default with a strength of 3,
  3. * meaning that it will break after 3 hits by a ball.
  4. * @param topIn The y position of the top of this Brick in the model.
  5. * @param leftIn The x position of the left side of this Brick in the model.
  6. */
  7. public Brick(int topIn, int leftIn)
  8. {
  9.  
  10. }
  11. /**
  12. * Creates a custom Brick object at a specified position with a specified strength.
  13. * @param topIn The y position of the top of this Brick in the model.
  14. * @param leftIn The x position of the left side of this Brick in the model.
  15. * @param hitsIn The initial strength of this Brick. A value greater than zero represents that this Brick +
  16. * will break after that number of hits. A value of 0 represents a "non-brick" or empty space in the model.
  17. * A value of -1 represents that this Brick cannot be broken at all, regardless of the number of hits.
  18. */
  19. Brick(int topIn, int leftIn, int hitsIn)
  20. {
  21.  
  22. }
  23. /**
  24. * The current color to represent this Brick's breakability state.
  25. * @return There are five possible Colors that can be returned based on the Brick's current strength:
  26. * Color.BLACK if this Brick cannot be broken; Color.WHITE if this Brick has been completely broken;
  27. * and Color.RED, Color.YELLOW, Color. GREEN if this Brick will break after 1, 2, and 3 more hits,
  28. * consecutively.
  29. */
  30. public javafx.scene.paint.Color getColor()
  31. {
  32. Color color = null;
  33.  
  34. return color;
  35.  
  36. }
  37. /**
  38. * This mutator method will update this Brick's state data to account for being hit by the Ball once.
  39. * @return true when the hit caused this brick to break completely, false otherwise.
  40. */
  41. public boolean hit()
  42. {
  43. return false;
  44.  
  45. }
  46. /**
  47. * This method implements a collision detection algorithm to identify whether this Brick is currently being
  48. * hit by a given Ball object. It will produce a return value to signal which side, if any, is currently
  49. * being hit.
  50. * @param theBall The Ball to examine for collision with this Brick.
  51. * @return A valid TouchPosition state representing where theBall is intersecting this Brick. When no collision
  52. * is detected at all or this Brick is already broken, NONE should be returned. Otherwise, TOP, BOTTOM,
  53. * LEFT, or RIGHT will be returned corresponding to which side of this Brick is currently being hit by theBall.
  54. */
  55. public TouchPosition isTouching(Ball theBall)
  56. {
  57. return null;
  58.  
  59. }
  60. /**
  61. * Retrieves a String representation of this Brick's current object state. The string will be formatted as:
  62. * "Brick at (tlx, tly, brx, bry)" where tlx/tly are the x and y coordinates of the top/left corner and brx/bry
  63. * are the x and y coordinates of the bottom right corner of this Brick.
  64. * @return The formatted state information about this Brick.
  65. */
  66. public java.lang.String toString()
  67. {
  68. return null;
  69.  
  70. }
Add Comment
Please, Sign In to add comment