Ejemplo n.º 1
0
Game::Game(MutationOfJBEngine *vm)
	: _vm(vm),
	  _randomSource("mutationofjb"),
	  _delayedLocalScript(nullptr),
	  _gui(*this, _vm->getScreen()),
	  _currentAction(ActionInfo::Walk),
	  _scriptExecCtx(*this),
	  _taskManager(*this),
	  _assets(*this) {

	_gameData = new GameData;
	loadGameData(false);

	EncryptedFile globalScriptFile;
	globalScriptFile.open("global.atn");
	_globalScript = new Script;
	_globalScript->loadFromStream(globalScriptFile);
	globalScriptFile.close();

	_localScript = nullptr;
	_room = new Room(this, _vm->getScreen());

	_gui.init();

	_taskManager.startTask(TaskPtr(new ObjectAnimationTask));
}
Ejemplo n.º 2
0
void GameMain::initGame(bool needCreate /*= false*/)
{
    if (needCreate == true)
    {
        changeView(GameView::GV_CHAR_CREATOR);
    }
    else
    {
        changeView(GameView::GV_GENERAL);
        loadGameData();
    }
}
Ejemplo n.º 3
0
Common::Error GlkEngine::loadGameState(int slot) {
	FileReference ref(slot, "", fileusage_SavedGame | fileusage_TextMode);

	strid_t file = _streams->openFileStream(&ref, filemode_Read);
	if (file == nullptr)
		return Common::kReadingFailed;

	Common::Error result = loadGameData(file);

	file->close();
	return result;
}
//-----------------------------------------------------------------
void BaseGameManager::initializeGameObjects()
{
    loadGameData();

    MapsManager::initialize();
    MapsManager::scanMaps();

    Physics::init();
    Weapon::init();

    ConsoleInterface::initialize(25);
    PowerUpInterface::initialize();

    GameManager::initializeGameLogic();
}
Ejemplo n.º 5
0
void FlashScene::showFlash(){
	Sprite* flashImage = Sprite::create("splash/[email protected]");
	flashImage->ignoreAnchorPointForPosition(false);

	flashImage->setPosition(this->getContentSize() / 2);
	flashImage->setOpacity(0);
	this->addChild(flashImage);

	FadeIn* fadeIn = FadeIn::create(.4f);
	DelayTime* delay = DelayTime::create(.5f);
	FadeOut* fadeOut = FadeOut::create(.2);
	CallFunc* callBack = CallFunc::create([=]() {
		loadGameData();
	});

	Sequence* sequence = Sequence::create(fadeIn, delay, fadeOut, callBack,
		nullptr);
	flashImage->runAction(sequence);
	
}
bool CreateSeaWorld::operator()(GameWorldGame& world) const
{
    // For consistent results
    initGameRNG(0);

    loadGameData(world.GetDescriptionWriteable());
    world.Init(size_);
    // Set everything to water
    DescIdx<TerrainDesc> t(0);
    const WorldDescription& desc = world.GetDescription();
    for(; t.value < desc.terrain.size(); t.value++)
    {
        if(desc.get(t).Is(ETerrain::Shippable) && desc.get(t).kind == TerrainKind::WATER) //-V807
            break;
    }
    RTTR_FOREACH_PT(MapPoint, size_)
    {
        MapNode& node = world.GetNodeWriteable(pt);
        node.t1 = node.t2 = t;
    }
Ejemplo n.º 7
0
LevelLoader::LevelLoader(std::string const & filename) 
{
	loadJSONData(filename);
	m_document.Parse<0>(m_JSONData.c_str());	
	loadGameData();
}