Advertisement
Cinestra

Project 3 StudentWorld.cpp part 1

May 25th, 2023
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. #include "StudentWorld.h"
  2. #include "GameConstants.h"
  3. #include <string>
  4. using namespace std;
  5.  
  6. #include "Actor.h"
  7. #include <iostream>
  8.  
  9. GameWorld* createStudentWorld(string assetPath)
  10. {
  11. return new StudentWorld(assetPath);
  12. }
  13.  
  14. // Students: Add code to this file, StudentWorld.h, Actor.h, and Actor.cpp
  15.  
  16. StudentWorld::StudentWorld(string assetPath)
  17. : GameWorld(assetPath)
  18. {
  19. m_board = new Board;
  20. m_peach = nullptr;
  21. m_yoshi = nullptr;
  22. }
  23.  
  24. int StudentWorld::init()
  25. {
  26. startCountdownTimer(99); // this placeholder causes timeout after 5 seconds
  27. m_peach = new Player(1, 0, 0, this);
  28. m_peach->do_something();
  29. return GWSTATUS_CONTINUE_GAME;
  30.  
  31. // string board_file = assetPath() + "board0" + to_string(getBoardNumber()) + ".txt";
  32.  
  33. }
  34.  
  35. int StudentWorld::move()
  36. {
  37. // This code is here merely to allow the game to build, run, and terminate after you hit ESC.
  38. // Notice that the return value GWSTATUS_NOT_IMPLEMENTED will cause our framework to end the game.
  39.  
  40. m_peach->do_something();
  41.  
  42. setGameStatText("Game will end in a few seconds");
  43.  
  44. if (timeRemaining() <= 0)
  45. return GWSTATUS_NOT_IMPLEMENTED;
  46.  
  47. return GWSTATUS_CONTINUE_GAME;
  48. }
  49.  
  50. void StudentWorld::cleanUp()
  51. {
  52. }
  53.  
  54. StudentWorld::~StudentWorld()
  55. {
  56. }
  57.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement