From 6b1dcc5df51df4a2d8b724187eb1bcdb4fd9df8b Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 14 Mar 2015 19:25:23 -0400 Subject: Added sound when you hit the ground Also split up components.cpp into files for each class, fixed a bug concerning falling off the screen when you change maps, and converted collision data into doubles. --- src/components/physics_body.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/components/physics_body.h (limited to 'src/components/physics_body.h') diff --git a/src/components/physics_body.h b/src/components/physics_body.h new file mode 100644 index 0000000..079cc51 --- /dev/null +++ b/src/components/physics_body.h @@ -0,0 +1,20 @@ +#ifndef PHYSICS_BODY_H +#define PHYSICS_BODY_H + +#include "entity.h" +#include + +class Game; + +class PhysicsBodyComponent : public Component { + public: + void receive(Game& game, Entity& entity, const Message& msg); + void tick(Game& game, Entity& entity, double dt); + void detectCollision(Game& game, Entity& entity, Entity& collider, std::pair old_position); + + protected: + std::pair velocity; + std::pair accel; +}; + +#endif -- cgit 1.4.1