Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int StudentWorld::move() {
- m_ticks++;
- for(int i = 0; i < m_actors.size(); i++)
- m_actors.at(i)->doSomething();
- // This code is here merely to allow the game to build, run, and terminate after you hit enter.
- // Notice that the return value GWSTATUS_NO_WINNER will cause our framework to end the simulation.
- if(m_ticks >= 100) // change to 2000 later
- return GWSTATUS_PLAYER_WON;
- else
- return GWSTATUS_CONTINUE_GAME;
- }
- bool StudentWorld::pebbleThere(int x, int y) {
- // for(int i = 0; i < m_actors.size(); i++) {
- // int iid = m_actors.at(i)->getID();
- // if(iid == IID_BABY_GRASSHOPPER)
- // return true; // cant use getID() :-(
- // }
- // return false;
- vector<Actor*>::iterator p = m_actors.begin();
- while (p != m_actors.end()) {
- if((*p)->doesItBlock()) {
- if(x == (*p)->getX() && y == (*p)->getY())
- return true;
- }
- p++;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement