Player Movement


The first feature to work on for this game is obviously the player's ability to move. This encompasses a few different things: player input, camera movement & character movement.

Player input is simple: WASD to move up, down, left and right around the screen. Movement was never one of the core gameplay aspects I was focused on, as it doesn't need to be much more than how it is currently.

Camera movement is something that I knew was going to be difficult to get exactly the way I wanted, and it definitely was. Because each level is planned to be relatively small, I made to decision to manually create boundaries for the camera viewport to stay within. This works fine, but requires a bit of tinkering with the boundaries to reduce any strange movement or angles that restrict the player's view.  Once it's working, it moves the camera to a natural position within each room where the player can see whats ahead of and around them within the current room.

Character movement is a matter of getting the speed right, as I don't want players to accidentally run out from behind cover in front of a guard because they couldn't react fast enough to the movement of the character to stop in time. I think the speed right now is a good balance between raw speed and control. I'm trying to make this sound like it was much more complicated than it actually was, like I said before, movement is not a focus of this game, its more about planning your movement path, and executing that plan quickly, which I think will be an enjoyable experience with the movement features in it's current state.

One additional thing I've been working on is the Stealth ability (which is related to movement so I figured I should talk about it here). What this does is allows the player to hide from enemies by deploying the tactical visual obscuring cardboard box, which simultaneously slow their movement speed to a crawl so that the player can't rely on it all the time. To activate the TVOC, press the spacebar, which starts a countdown on screen telling the player how long they can use it for before it deactivates. Think of it like a "get out of jail free" ability. 

This was implemented by adding a new function to the existing movement script which when called (by holding spacebar) slows the player's movement from 7 units to 1, making them invisible to all enemies, then starts a coroutine to count 5 seconds before returning the player's movement back to 7 units, making them once again visible to enemies and resetting the 5 second counter. In the final game my intention is to limit this ability to a maximum of 3 charges, where the player can collect boxes from around the level to increase their charges. I've attached 2 screenshots showing this functionality in action, by placing boxes in the level. My plan to implement this to spawn a disabled box over the player, then set it to enable when they enter stealth mode, which will block the view of the enemy without having to change how the line-of-sight detection system works, then disable that box when the counter hits 0.

Leave a comment

Log in with itch.io to leave a comment.