Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "StudentWorld.h"
- #include "GameConstants.h"
- #include <string>
- using namespace std;
- #include "Actor.h"
- #include <iostream>
- GameWorld* createStudentWorld(string assetPath)
- {
- return new StudentWorld(assetPath);
- }
- // Students: Add code to this file, StudentWorld.h, Actor.h, and Actor.cpp
- StudentWorld::StudentWorld(string assetPath)
- : GameWorld(assetPath)
- {
- m_board = new Board;
- m_peach = nullptr;
- m_yoshi = nullptr;
- }
- int StudentWorld::init()
- {
- startCountdownTimer(99); // this placeholder causes timeout after 5 seconds
- m_peach = new Player(1, 0, 0, this);
- m_peach->do_something();
- return GWSTATUS_CONTINUE_GAME;
- // string board_file = assetPath() + "board0" + to_string(getBoardNumber()) + ".txt";
- }
- int StudentWorld::move()
- {
- // This code is here merely to allow the game to build, run, and terminate after you hit ESC.
- // Notice that the return value GWSTATUS_NOT_IMPLEMENTED will cause our framework to end the game.
- m_peach->do_something();
- setGameStatText("Game will end in a few seconds");
- if (timeRemaining() <= 0)
- return GWSTATUS_NOT_IMPLEMENTED;
- return GWSTATUS_CONTINUE_GAME;
- }
- void StudentWorld::cleanUp()
- {
- }
- StudentWorld::~StudentWorld()
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement