説明なし

work.cpp 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #include "play.h"
  2. #include <ctime>
  3. void play::setTrack(Track track_type){
  4. // This function is used to set the type of track allowed for
  5. // this game. The types of tracks are (play::DAY, play::NIGHT, play::BEACH,
  6. // play::CANDYLAND).
  7. // You will define a switch to select the track of the game, and
  8. // the obstacles according to the track_type received.
  9. // The tracks background and obstacles are:
  10. // For track type Day
  11. // the obstacles are hole and cone.
  12. // For track type Night
  13. // the obstacles are it or zombie
  14. // For track type Beach
  15. // the obstacles are spongebob or patrick
  16. // For track type Candyland
  17. // the obstacles is monster
  18. // To set the track background simply set the variable (track) to the path of
  19. // the background.
  20. // To set the obstacles, use the function setObstaclesPixmap()
  21. // For instance: setObstaclesPixmap("cone") ;
  22. }
  23. bool play::obstacleCollision(Obstacle &obs, Car &car){
  24. // Complete the function using the selection structure if/else
  25. // to detect a collision between the obstacle and the car.
  26. // Recall from the instructions that the car does not move in the
  27. // X axis and that the fix X asix is stored in CARX.
  28. // OBSTACLERANGE contains the range from the obstacle center to
  29. // each side.
  30. }
  31. void play::flagCollision(Flag &flag, Car &car){
  32. // Complete the function using the selection structure if/else
  33. // to detect a collision between the flag and the car.
  34. // Recall from the instructions that the car does not move in the
  35. // X axis and that the fix X asix is stored in CARX.
  36. // FLAGRANGE contains the range from the flag center to
  37. // each side.
  38. // If there is a collision set the score to 30 more points
  39. // and hide the flag.
  40. }