Help rotating the camera with my player
Posted: Tue Dec 02, 2014 12:04 pm
Hey guys!
I've looked around (viewtopic.php?f=4&t=78216, https://github.com/kikito/gamera) but really can't figure out just where I'm going wrong when trying to rotate the camera so my player always faces "up" in my little game.
The code can be found here - https://github.com/n1c/dash as far as I can tell I should be setting the rotation here https://github.com/n1c/dash/blob/master/game.lua#L41 based on the player's angle in the world. Though that seems wrong in practice.
Any insight would be greatly appreciated! Gamedev is new to me and it's been quite a while since doing trig so I feel so in the dark!
I've looked around (viewtopic.php?f=4&t=78216, https://github.com/kikito/gamera) but really can't figure out just where I'm going wrong when trying to rotate the camera so my player always faces "up" in my little game.
The code can be found here - https://github.com/n1c/dash as far as I can tell I should be setting the rotation here https://github.com/n1c/dash/blob/master/game.lua#L41 based on the player's angle in the world. Though that seems wrong in practice.
Any insight would be greatly appreciated! Gamedev is new to me and it's been quite a while since doing trig so I feel so in the dark!
