Ejemplo n.º 1
0
void Player::Update(const jutil::GameTime& timespan)
{
	if (m_Health <= 0)
	{
		HandleDeath(timespan);
		return;
	}

	if (m_TimerInvincibility.ElapsedMilliseconds() < INVINCIBILITY_TIME)
	{
		HandleInvincibility(timespan);
	}
	else
	{
		SetAlpha(1.f);
		m_PlayerState = UNKNOWN;
	}

	HandleLevelCollisionResolution(timespan);

	// Jumping controls
	if (m_PlayerState != TAKING_DAMAGE)
	{
		HandleControls(timespan);
	}

	HandleBullets(timespan);
	SetAnimationFrame();
}
Ejemplo n.º 2
0
HRESULT WINAPI D3DProxyDeviceMono::BeginScene()
{
    HandleControls();
//	HandleTracking();
    ComputeViewTranslation();

    return D3DProxyDevice::BeginScene();
}
void ArcBallCameraController::Update(const GameTime& gameTime_)
{
	float rightAxis = 0.0f;
	float upAxis = 0.0f;
	float forwardAxis = 0.0f;
	float horizontalOrbit = 0.0f;
	float verticalOrbit = 0.0f;
	float rollOrbit = 0.0f;
	float zoom = 0.0f;

	const float step = 1.0f;

	//Keyboard
	if (Game::Instance()->GetInput().IsKeyDown(sf::Keyboard::Right) == true)
	{
		rightAxis = -step;
	}
	else if (Game::Instance()->GetInput().IsKeyDown(sf::Keyboard::Left) == true)
	{
		rightAxis = step;
	}

	if (Game::Instance()->GetInput().IsKeyDown(sf::Keyboard::Up) == true)
	{
		forwardAxis = step;
	}
	else if (Game::Instance()->GetInput().IsKeyDown(sf::Keyboard::Down) == true)
	{
		forwardAxis = -step;
	}

	if (Game::Instance()->GetInput().IsKeyDown(sf::Keyboard::PageUp) == true)
	{
		upAxis = step;
	}
	else if (Game::Instance()->GetInput().IsKeyDown(sf::Keyboard::PageDown) == true)
	{
		upAxis = -step;
	}

	if (Game::Instance()->GetInput().IsMouseButtonDown(sf::Mouse::Middle) == true)
	{
		horizontalOrbit = (float) -Game::Instance()->GetInput().GetDeltaMouseX();
		verticalOrbit = (float) -Game::Instance()->GetInput().GetDeltaMouseY();
	}

	//Touch
	if (Game::Instance()->GetInput().IsTouchMove(0) == true)
	{
		horizontalOrbit = (float) -Game::Instance()->GetInput().TouchMoveDeltaX(0);
		verticalOrbit = (float) -Game::Instance()->GetInput().TouchMoveDeltaY(0);
		CA_TRACE("TouchMove x:%f y=%f\n", horizontalOrbit, verticalOrbit);
	}

	//
	HandleControls(gameTime_, rightAxis, upAxis, forwardAxis,
		horizontalOrbit, verticalOrbit, rollOrbit, zoom);
}
Ejemplo n.º 4
0
HRESULT WINAPI D3DProxyDeviceTest::BeginScene()
{
	HandleControls();

	if(saveDebugFile)
	{
		debugFile.open("d3d9_debug.txt", std::ios::out);
	}

	return D3DProxyDevice::BeginScene();
}
Ejemplo n.º 5
0
HRESULT WINAPI D3DProxyDeviceEgo::BeginScene()
{
	HandleControls();
	HandleTracking();
	ComputeViewTranslation();

	if(saveDebugFile)
	{
		debugFile.open("d3d9_debug.txt", std::ios::out);
	}

	return D3DProxyDevice::BeginScene();
}