Squid does not move until space is pressed. Experimenting with scroll. This shouldn't really be committed, but Visual Studio.

This commit is contained in:
PlatinumSkink
2015-10-07 17:09:55 +02:00
parent b7696b8776
commit 3814c25931
11 changed files with 109 additions and 10 deletions
+6 -2
View File
@@ -28,6 +28,7 @@ void dd::Systems::PadSystem::Initialize()
EVENT_SUBSCRIBE_MEMBER(m_EContactPowerUp, &PadSystem::OnContactPowerUp);
EVENT_SUBSCRIBE_MEMBER(m_EStageCleared, &PadSystem::OnStageCleared);
EVENT_SUBSCRIBE_MEMBER(m_EPause, &PadSystem::OnPause);
//EVENT_SUBSCRIBE_MEMBER(m_EBindKey, &PadSystem::OnBindKey);
{
auto ent = m_World->CreateEntity();
@@ -41,6 +42,7 @@ void dd::Systems::PadSystem::Initialize()
physics->Category = CollisionLayer::Type::Pad;
physics->Mask = static_cast<CollisionLayer::Type>(CollisionLayer::Ball | CollisionLayer::PowerUp);
physics->Calculate = true;
ctransform->Sticky = true;
auto cModel = m_World->AddComponent<Components::Model>(ent);
cModel->ModelFile = "Models/Submarine2.obj";
@@ -123,8 +125,7 @@ bool dd::Systems::PadSystem::OnPause(const dd::Events::Pause &event)
return true;
}
bool dd::Systems::PadSystem::OnKeyDown(const dd::Events::KeyDown &event)
{
bool dd::Systems::PadSystem::OnKeyDown(const dd::Events::KeyDown &event) {
int val = event.KeyCode;
if (val == GLFW_KEY_UP) {
//std::cout << "Up!" << std::endl;
@@ -154,6 +155,9 @@ bool dd::Systems::PadSystem::OnKeyDown(const dd::Events::KeyDown &event)
e.Time = 0.2;
e.Type = "All";
EventBroker->Publish(e);
} else if (val == GLFW_KEY_SPACE) {
Events::ActionButton e;
EventBroker->Publish(e);
} else if (val == GLFW_KEY_D) {
return false;
}