Math Blog
This week within Game Development I had to implement crouching down into our game, and leaned on boolean algebra (Standard: Algebra and Functions) to be able to signal when to move the camera down, along with signal to the enemy AI that the player cannot be detected unless there is direct line of sight. The code itself was rather simple, as it was just setting the boolean variable whenever there was an input and than within the process that is called every frame detecting if the variable was either true or false.
(The code detecting inputs, than setting the variable respectively)
Along with using boolean algebra, I had to have an understanding of linear interpolation and translations (Standard: Number & Quantity) to be able to smoothly move the camera down in game when the code mentioned above detects that the player is crouching. This was necessary because without the smooth transition between crouching and standing (and vice versa) the players camera snaps which not only does not look as good as a smooth transition, it could cause motion sickness in certain groups of players (granted this game is probably not the best for that subset of players for a multitude of other reasons).
Leave a comment