GameState::GameState(StateStack& stack, Context context)
	: State(stack, context)
	, mECSM()
	, clearColor(sf::Color(237,182,31))
{

	initializeSystems();
	createBackground();
	createSwing();
	startMusic();

	// TESTING

	sf::Sprite* personSprite = new sf::Sprite();
	personSprite->setTexture(getContext().textures->get(Textures::Person));
	personSprite->setScale(sf::Vector2f(-4.0f, 4.0f));

	Entity* testPerson = new Entity(2);
	testPerson->addComponent(new ComponentPosition(20, 550));
	testPerson->addComponent(new ComponentVelocity(0.1f, 0));
	testPerson->addComponent(new ComponentSprite(personSprite));

	mECSM.registerEntity(testPerson);

	// DONE TESTING

}
예제 #2
0
 void Engine::run()
 {
     initializeSystems();
     updateSystems();
     shutdownSystems();
 }