summary refs log tree commit diff stats
path: root/src/components/player_physics.cpp
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2015-03-19 16:15:47 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2015-03-19 16:15:47 -0400
commit4b4125e234cb727c70822e0a1fce0688c357741e (patch)
tree5b446ebe6f0454304d4202368bd18fba3f629d3d /src/components/player_physics.cpp
parent281bdf956a646fd8c9944e9a44f867c984792216 (diff)
downloadtherapy-4b4125e234cb727c70822e0a1fce0688c357741e.tar.gz
therapy-4b4125e234cb727c70822e0a1fce0688c357741e.tar.bz2
therapy-4b4125e234cb727c70822e0a1fce0688c357741e.zip
Implemented a simple AI
Diffstat (limited to 'src/components/player_physics.cpp')
-rw-r--r--src/components/player_physics.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/components/player_physics.cpp b/src/components/player_physics.cpp index 1d14f35..40e9948 100644 --- a/src/components/player_physics.cpp +++ b/src/components/player_physics.cpp
@@ -29,12 +29,12 @@ void PlayerPhysicsComponent::receive(Game&, Entity& entity, const Message& msg)
29 { 29 {
30 velocity.first = 0.0; 30 velocity.first = 0.0;
31 direction = 0; 31 direction = 0;
32 } else if (msg.type == Message::Type::stopMovingHorizontally) 32 } else if (msg.type == Message::Type::setHorizontalVelocity)
33 { 33 {
34 velocity.first = 0.0; 34 velocity.first = msg.velocity;
35 } else if (msg.type == Message::Type::stopMovingVertically) 35 } else if (msg.type == Message::Type::setVerticalVelocity)
36 { 36 {
37 velocity.second = 0.0; 37 velocity.second = msg.velocity;
38 } else if (msg.type == Message::Type::hitTheGround) 38 } else if (msg.type == Message::Type::hitTheGround)
39 { 39 {
40 if (isFalling) 40 if (isFalling)