Ball hitting bricks destroys bricks! We can PLAY! (kind of)

This commit is contained in:
PlatinumSkink
2015-09-11 10:50:49 +02:00
parent 7e945c85d3
commit c829315598
8 changed files with 151 additions and 44 deletions
+10 -4
View File
@@ -9,11 +9,13 @@
#include "Core/CTransform.h"
#include "Rendering/CSprite.h"
#include "Game/CBrick.h"
//#include "Core/EContact.h"
#include "Physics/EContact.h"
#include "Core/EventBroker.h"
#include "Core/World.h"
#include "Game/CBall.h"
#include "Game/EStageCleared.h"
#include "Physics/CBoxShape.h"
#include "Physics/CPhysics.h"
#include <fstream>
#include <iostream>
#include <intrin.h>
@@ -54,10 +56,14 @@ public:
void EndLevel();
private:
//dd::EventRelay<LevelSystem, dd::Events::Contact> m_EContact;
void Update(double dt);
bool OnContact(/*const dd::Events::Contact &event*/);
private:
dd::EventRelay<LevelSystem, dd::Events::Contact> m_EContact;
bool OnContact(const dd::Events::Contact &event);
bool m_Initialized = false;
int numberOfBricks;
int tRows = 7;
+5 -3
View File
@@ -13,6 +13,8 @@
#include "Input/EBindKey.h"
//#include "Core/EContact.h"
#include "Core/CTransform.h"
#include "Physics/CBoxShape.h"
#include "Physics/CPhysics.h"
#include "Rendering/CSprite.h"
#include "Game/CBall.h"
#include "Core/Component.h"
@@ -33,6 +35,7 @@ public:
void Initialize() override;
void Update(double dt) override;
private:
dd::EventRelay<PadSystem, dd::Events::KeyDown> m_EKeyDown;
dd::EventRelay<PadSystem, dd::Events::KeyUp> m_EKeyUp;
@@ -51,9 +54,8 @@ private:
class PadSteeringInputController;
std::array<std::shared_ptr<PadSteeringInputController>, 4> m_PadInputControllers;
EntityID ent;
std::shared_ptr<Components::Transform> transform;
std::shared_ptr<Components::Sprite> sprite;
EntityID ent = 0;
Components::Transform* transform;
glm::vec3 acceleration = glm::vec3(0.f, 0.f, 0.f);
bool left = false, right = false;
};