From f0eab98e417bf648261a9027bef91fe935af76cb Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 20 Feb 2021 13:34:04 -0500 Subject: Added variable movement speed Ionia now moves at half Lucas's speed, which I think is good for NPCs. --- src/input_system.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/input_system.cpp') 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) { for (int spriteId : game_.getSprites()) { Sprite& sprite = game_.getSprite(spriteId); if (sprite.controllable) { - vec2i checkLoc = sprite.loc + (unitVecInDirection(sprite.dir) * MOVEMENT_SPEED); + // Interacting with objects always uses Lucas's movement speed. + vec2i checkLoc = sprite.loc + (unitVecInDirection(sprite.dir) * LUCAS_MOVEMENT_SPEED); CollisionResult collision = game_.getSystem().checkCollision(spriteId, checkLoc, sprite.dir); if (collision.horiz.blocked || collision.vert.blocked) { -- cgit 1.4.1