예제 #1
0
파일: Game.cpp 프로젝트: jhpy1024/glfPong
void Game::resetGame()
{
    createEntities();
    m_GameOver = false;
    m_Score = 0;
    m_Lives = 3;
}
예제 #2
0
void main()
{
	/* Create Entities for Patient */
	createEntities();
	
	/* Run patient code */
	patient();

	Exit(0);	
}
예제 #3
0
    void Application::onInit() {
        glShadeModel(GL_SMOOTH);
		try {
			createEntities();
		} catch(std::runtime_error& e) {
			DebugFile::instance()->writeException(e);
			throw e;
		}
		Registry::instance()->init();
    }
예제 #4
0
void ObjectNode::reloadEntities(Ogre::SceneManager *scene_manager, LibGens::ModelLibrary *model_library, LibGens::MaterialLibrary *material_library, LibGens::ObjectProduction *object_production, string slot_id_name) {
	string temp_model_name     = current_model_name;
	string temp_skeleton_name  = current_skeleton_name;
	string temp_animation_name = current_animation_name;
	string temp_type_name      = current_type_name;

	if (scene_node) {
		createEntities(scene_node, scene_manager, model_library, material_library, object_production, slot_id_name);
	}

	list<LibGens::MultiSetNode *> msp_nodes = object->getMultiSetParam()->getNodes();
	for (list<ObjectMultiSetNode *>::iterator it = object_msp_nodes.begin(); it != object_msp_nodes.end(); it++) {
		current_model_name = temp_model_name;
		current_skeleton_name = temp_skeleton_name;
		current_animation_name = temp_animation_name;
		current_type_name = temp_type_name;

		createEntities((*it)->getSceneNode(), scene_manager, model_library, material_library, object_production, slot_id_name);
	}
}
예제 #5
0
//-------------------------------------------------------------------------------------
void BallGame::createScene(void)
{
	 // create your scene here :)

	setupGame();
	
	createAmbientLight();
	
	createEntities();

	createCameraFollower();

	setupPhysicsObject();
}
void CommandLineInterface::mainMenu() {
  while (true) {
    std::cout << "\n";
    std::cout << "Type a command (type 'help' or 'h' for help)" << std::endl;
    std::cout << "\n";
    std::cout << "> ";
    std::string input;
    std::getline(std::cin, input);
    std::vector<std::string> args = string_utils::split(input);
    if (args.empty()) {
      std::cout << "Invalid input." << std::endl;
    } else {
      std::string command = args[0];
      args.erase(args.begin());
      clearScreen();
      if (command == "create") {
        createEntities(args);
      } else if (command == "remove" || command == "delete") {
        removeEntities(args);
      } else if (command == "list" || command == "l") {
        listEntities(args);
      } else if (command == "setq") {
        setQueue(args);
      } else if (command == "unsetq") {
        unsetQueue(args);
      } else if (command == "start") {
        startQueueHandler(args);
      } else if (command == "stop") {
        stopQueueHandler(args);
      } else if (command == "watch" || command == "w") {
        watch();
      } else if (command == "help" || command == "h") {
        showHelp();
      } else if (command == "quit" || command == "q") {
        std::cout << "Bye." << std::endl;
        break;
      } else {
        std::cout << "Sorry. Command not recognized." << std::endl;
      }
    }
  }
}
예제 #7
0
파일: DemoKeeper.cpp 프로젝트: MyGUI/mygui
	void DemoKeeper::createScene()
	{
		base::BaseDemoManager::createScene();
		createEntities();

		const MyGUI::VectorWidgetPtr& root = MyGUI::LayoutManager::getInstance().loadLayout("HelpPanel.layout");
		if (root.size() == 1)
			root.at(0)->findWidget("Text")->castType<MyGUI::TextBox>()->setCaption("Implementation of custom complex cursor behaviour, interaction of system and in-game cursors.");

		std::string resourceCategory = MyGUI::ResourceManager::getInstance().getCategoryName();
		MyGUI::FactoryManager::getInstance().registerFactory<ResourcePointerContext>(resourceCategory);

		MyGUI::ResourceManager::getInstance().load("Contexts.xml");

#ifdef MYGUI_SAMPLES_INPUT_OIS
		MyGUI::ResourceManager::getInstance().load("DemoPointers.xml");
#elif MYGUI_SAMPLES_INPUT_WIN32
		MyGUI::ResourceManager::getInstance().load("DemoPointersW32.xml");
#elif MYGUI_SAMPLES_INPUT_WIN32_OIS
		MyGUI::ResourceManager::getInstance().load("DemoPointersW32.xml");
#endif

		mPointerContextManager = new PointerContextManager(this);
		mPointerContextManager->addContext("ptrx_Normal");
		mPointerContextManager->setPointer("default");

		mEnemyPanel = new EnemyPanel();
		mFriendPanel = new FriendPanel();
		mControlPanel = new ControlPanel(mPointerContextManager);

		MyGUI::IntSize size = MyGUI::RenderManager::getInstance().getViewSize();
		setMousePosition(size.width / 2, size.height / 2);
		updateCursorPosition();

#ifdef MYGUI_OGRE_PLATFORM
		mEnemyPanel->setVisible(false);
		mFriendPanel->setVisible(false);
#endif

		updateCamera(0, 0);
	}
예제 #8
0
void DemoGLWidget::initializeGL ()
{
    glClearColor(0.1f, 0.1f, 0.2f, 1.0f);

    if(!USE_SOUND)
    {
        qDebug("Creating entities");
        createEntities(NUM_ENTITIES);
    }

    // Particles
    for (int i = 0; i < 40; ++i) {
        float x = rand()%(800 + 2*PARTICLE_PHASE_MAX_x_OFFSET);
        float y = rand()%(480)+ 2*PARTICLE_PHASE_MAX_y_OFFSET;

        QPointF position(x - PARTICLE_PHASE_MAX_x_OFFSET, y - PARTICLE_PHASE_MAX_y_OFFSET);
        qreal radius = qMin(1.0, 3.0f * qrand()/(RAND_MAX+1.0));

        particles.append(new Particle(position, radius));
    }
}
예제 #9
0
파일: Game.cpp 프로젝트: jhpy1024/glfPong
void Game::run()
{
    createEntities();
}