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
+3
View File
@@ -41,6 +41,9 @@ struct Transform : public Component
glm::vec3 Velocity;
/** Physical scale multiplier. */
glm::vec3 Scale;
// Sticky is if it sticks with the player or not. True means it will follow the camera.
bool Sticky;
};
}
+16
View File
@@ -168,11 +168,22 @@ public:
auto transform = m_World->AddComponent<Components::Transform>(t_halfPipe);
transform->Position = glm::vec3(0.f, 0.f, -15.f);
transform->Scale = glm::vec3(6.f, 6.f, 10.f);
transform->Sticky = false;
auto model = m_World->AddComponent<Components::Model>(t_halfPipe);
model->ModelFile = "Models/Test/halfpipe/Halfpipe.obj";
model->Color = glm::vec4(1.f, 0.f, 0.f, 0.3f);
m_World->CommitEntity(t_halfPipe);
}
/*{
auto t_halfPipe = m_World->CreateEntity();
auto transform = m_World->AddComponent<Components::Transform>(t_halfPipe);
transform->Position = glm::vec3(0.f, 6.f, -15.f);
transform->Scale = glm::vec3(6.f, 6.f, 10.f);
auto model = m_World->AddComponent<Components::Model>(t_halfPipe);
model->ModelFile = "Models/Test/halfpipe/Halfpipe.obj";
model->Color = glm::vec4(1.f, 0.f, 0.f, 0.3f);
m_World->CommitEntity(t_halfPipe);
}*/
//Background
{
@@ -247,6 +258,7 @@ public:
rectangleShape->Dimensions = glm::vec2(20.f, 0.5f);
std::shared_ptr<Components::Physics> physics = m_World->AddComponent<Components::Physics>(BottomWall);
physics->CollisionType = CollisionType::Type::Static;
transform->Sticky = true;
m_World->CommitEntity(BottomWall);
}
@@ -266,6 +278,7 @@ public:
physics->CollisionType = CollisionType::Type::Static;
physics->Category = CollisionLayer::Wall;
physics->Mask = static_cast<CollisionLayer::Type>(CollisionLayer::Ball | CollisionLayer::Brick);
transform->Sticky = true;
m_World->CommitEntity(topWall);
}
@@ -287,6 +300,7 @@ public:
physics->CollisionType = CollisionType::Type::Static;
physics->Category = CollisionLayer::Wall;
physics->Mask = static_cast<CollisionLayer::Type>(CollisionLayer::Ball | CollisionLayer::Brick);
transform->Sticky = true;
m_World->CommitEntity(leftWall);
}
@@ -308,6 +322,8 @@ public:
physics->CollisionType = CollisionType::Type::Static;
physics->Category = CollisionLayer::Wall;
physics->Mask = static_cast<CollisionLayer::Type>(CollisionLayer::Ball | CollisionLayer::Brick);
transform->Sticky = true;
m_World->CommitEntity(rightWall);
}
+5 -1
View File
@@ -25,6 +25,7 @@
#include "Game/EPause.h"
#include "Game/EHitPad.h"
#include "Game/EHitLag.h"
#include "Game/EActionButton.h"
namespace dd
{
@@ -89,6 +90,7 @@ private:
int m_PastLives = 3;
bool m_ReplaceBall = false;
bool m_Pause = false;
bool m_Waiting = true;
EntityID m_LastCollision = 999999;
glm::vec3 m_SavedSpeed;
@@ -104,7 +106,8 @@ private:
dd::EventRelay<BallSystem, dd::Events::ResetBall> m_EResetBall;
dd::EventRelay<BallSystem, dd::Events::MultiBall> m_EMultiBall;
dd::EventRelay<BallSystem, dd::Events::Pause> m_EPause;
EventRelay<BallSystem, Events::Contact> m_Contact;
dd::EventRelay<BallSystem, dd::Events::Contact> m_Contact;
dd::EventRelay<BallSystem, dd::Events::ActionButton> m_EActionButton;
bool Contact(const Events::Contact &event);
bool OnLifeLost(const dd::Events::LifeLost &event);
@@ -112,6 +115,7 @@ private:
bool OnResetBall(const dd::Events::ResetBall &event);
bool OnMultiBall(const dd::Events::MultiBall &event);
bool OnPause(const dd::Events::Pause &event);
bool OnActionButton(const dd::Events::ActionButton &event);
};
}
+1
View File
@@ -19,6 +19,7 @@ struct Ball : Component
float Speed = 5.f;
int Combo = 0;
bool Paused = false;
bool Waiting = true;
glm::vec3 SavedSpeed = glm::vec3(0, 0, 0);
};
+25
View File
@@ -0,0 +1,25 @@
//
// Created by Administrator on 2015-10-07.
//
#ifndef DAYDREAM_EACTIONBUTTON_H
#define DAYDREAM_EACTIONBUTTON_H
#include "Core/EventBroker.h"
namespace dd
{
namespace Events
{
struct ActionButton : Event
{
};
}
}
#endif //DAYDREAM_EACTIONBUTTON_H
+2 -1
View File
@@ -13,7 +13,8 @@ namespace Events
{
struct StageCleared : Event
{
int StageCleared = 0;
int StageCluster = 0;
};
}
}
+1
View File
@@ -30,6 +30,7 @@
#include "Game/EStageCleared.h"
#include "Game/EPause.h"
#include "Game/EHitLag.h"
#include "Game/EActionButton.h"
namespace dd