예제 #1
0
	HillsideBattleground::HillsideBattleground(float x1, float y1) : Stage(x1, y1)
	{
		setSpawnPoint(0, 0,0);
		setSpawnPoint(1, -110,-110);
		setSpawnPoint(2,  110,-110);
		setSpawnPoint(3,    0,-138);
		setSpawnPoint(4,    0, -10);
		
		bottomViewBorder = 255;
		topViewBorder = -255;
		leftViewBorder = -320;
		rightViewBorder = 320;
		
		leftBorder = -400;
		topBorder = -380;
		rightBorder = 400;
		bottomBorder = 320;
		
		setItemBoundaries(-200, -150, 190, 80);
		
		loadGameElements();
		loadPlatforms();
		loadHangPoints();
		loadGround();
		
		setBackground("Images/Game/Stages/HillsideBattleground/bg.png");
		setBackgroundScale(1.45);
		setBackgroundType(BG_FIXED);
		
		//setWireframeColor(Color.blue);
		//showWireframes(true);
		
		MusicManager::loadSong("Battlefield v2");
	}
예제 #2
0
void BillboardSample::initialize()
{
    setMultiTouch(true);

	// Create the font and scene
    _font = Font::create("res/ui/arial.gpb");
	_scene = Scene::create();

	// Initialize the camera
    _camera.initialize(0.1f, 100, 45);
    _camera.setPosition(Vector3(0, BILLBOARD_HEIGHT * 1.5f, GROUND_WIDTH / 2.0f));
	_camera.rotate(0.0f, -MATH_DEG_TO_RAD(10));
    _scene->addNode(_camera.getRootNode());
    _scene->setActiveCamera(_camera.getCamera());

	// Load the ground
	loadGround();

    // Load billboards
    loadBillboards();

    _gamepad = getGamepad(0);
    // This is needed because the virtual gamepad is shared between all samples.
    // SamplesGame always ensures the virtual gamepad is disabled when a sample is exited.
    if (_gamepad && _gamepad->isVirtual())
        _gamepad->getForm()->setEnabled(true);
}