예제 #1
0
파일: World.cpp 프로젝트: yiochen/Cheese
//init world init game for a certain level
World* World::initWorld(Node* backgroundLayer, Node* actionLayer, Node* HUDnode) {
	this->backgroundNode = backgroundLayer;
	this->actionNode = actionLayer;
	this->hudNode = HUDnode;
	swiss = NULL;
	score = 0;
	CCLOG("Created the world");
	//initialize the Pools
	initSpriteCache();
	//initialize all the game objects/entities
	initCommonComps();
	initPools();
	initPlayers();
	//initialize all the entity runners
	
	initRunners();
	infoPanel = new InformationPanel();

	if (!Config::instance()->debug_mode) {//if debug mode is turned off
		spawningPool = new ZombieSpawningPool();
		if (spawningPool) spawningPool->init();
	}

	destroyFlag = false;
	
	return this;
}
예제 #2
0
Globals::Globals(Config *config) : config_(config), loader_(new Loader()),
	handlerSet_(new HandlerSet()), componentSet_(new ComponentSet()), logger_(NULL)
{
	loader_->init(config);
	componentSet_->init(this);
	handlerSet_->init(config, componentSet_.get());

	initLogger();
	initPools();
	startThreadPools();
}
예제 #3
0
bool BlockManager::init()
{
	if (!Node::init())
	{
		return false;
	}

	initPools();
	reset();

	return true;
}