LevelFour::LevelFour() : Stage() { //step("[LevelFour] Constructing."); defineBackground(); generatePlatform(); generateSecondLayer(); generateEnemies(); generateCivilians(); setFinished(false); setGameOver(false); }
bool GameLayer::init() { //NULLIFY! ground = NULL; m_world = NULL; cannon = NULL; background = NULL; backgroundLight = NULL; //SET WIN SIZE winSize = Director::getInstance()->getVisibleSize(); worldStartX = 0; worldEndX = 5*winSize.width/3; worldHeight = worldEndX; perspectiveX = (3*winSize.width)/4; trajectoryFrames = 0; if ( !Layer::init() ) return false; directionPoint.Set( 100, 100 ); globalScale = 0.5; //INIT BACKGROUND initBackground(); //INIT BOX2D initBox2D(); //CREATE GROUND initGround(); //GENERATE CLOUDS generateClouds(); //CREATE CANNON initCannon(); //GENERATE ENEMIES generateEnemies(); this->setTouchEnabled(true); this->schedule( schedule_selector(GameLayer::tick) ); return true; }