Exemplo n.º 1
0
DuelMatch::DuelMatch(bool remote, std::string rules) :
		// we send a pointer to an unconstructed object here!
		mLogic(createGameLogic(rules, this)),
		mPaused(false),
		events(0),
		external_events(0),
		mRemote(remote)
{
	mPhysicWorld.reset( new PhysicWorld() );

	setInputSources(boost::make_shared<InputSource>(), boost::make_shared<InputSource>());
}
Exemplo n.º 2
0
DuelMatch::DuelMatch(InputSource* linput, InputSource* rinput,
				bool global, bool remote):mLogic(createGameLogic("rules.lua")),
					mPaused(false), events(0), external_events(0), mRemote(remote)
{
	mGlobal = global;
	if (mGlobal)
	{
		assert(mMainGame == 0);
		mMainGame = this;
	}

	mLeftInput = linput;
	mRightInput = rinput;

	mBallDown = false;

	mPhysicWorld.resetPlayer();
	mPhysicWorld.step();

	UserConfig gameConfig;
	gameConfig.loadFile("config.xml");
	mLogic->setScoreToWin(gameConfig.getInteger("scoretowin"));
};
Exemplo n.º 3
0
void DuelMatch::setRules(std::string rulesFile)
{
	mLogic = createGameLogic(rulesFile, this);
}