diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-20 13:34:04 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-20 13:34:04 -0500 |
commit | f0eab98e417bf648261a9027bef91fe935af76cb (patch) | |
tree | 7c212cbe8bd549d5a6229c616806095596859a8f /src/input_system.cpp | |
parent | ca4935cb65325edbd45d4a3aacc921ea9ed9483b (diff) | |
download | tanetane-f0eab98e417bf648261a9027bef91fe935af76cb.tar.gz tanetane-f0eab98e417bf648261a9027bef91fe935af76cb.tar.bz2 tanetane-f0eab98e417bf648261a9027bef91fe935af76cb.zip |
Added variable movement speed
Ionia now moves at half Lucas's speed, which I think is good for NPCs.
Diffstat (limited to 'src/input_system.cpp')
-rw-r--r-- | src/input_system.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/input_system.cpp b/src/input_system.cpp index 2201907..43c59dd 100644 --- a/src/input_system.cpp +++ b/src/input_system.cpp | |||
@@ -40,7 +40,8 @@ void InputSystem::tick(double dt) { | |||
40 | for (int spriteId : game_.getSprites()) { | 40 | for (int spriteId : game_.getSprites()) { |
41 | Sprite& sprite = game_.getSprite(spriteId); | 41 | Sprite& sprite = game_.getSprite(spriteId); |
42 | if (sprite.controllable) { | 42 | if (sprite.controllable) { |
43 | vec2i checkLoc = sprite.loc + (unitVecInDirection(sprite.dir) * MOVEMENT_SPEED); | 43 | // Interacting with objects always uses Lucas's movement speed. |
44 | vec2i checkLoc = sprite.loc + (unitVecInDirection(sprite.dir) * LUCAS_MOVEMENT_SPEED); | ||
44 | CollisionResult collision = game_.getSystem<TransformSystem>().checkCollision(spriteId, checkLoc, sprite.dir); | 45 | CollisionResult collision = game_.getSystem<TransformSystem>().checkCollision(spriteId, checkLoc, sprite.dir); |
45 | 46 | ||
46 | if (collision.horiz.blocked || collision.vert.blocked) { | 47 | if (collision.horiz.blocked || collision.vert.blocked) { |