Handmade Hero»Forums»Code
Gonçalo Santos
5 posts
Studying Electrical and Computers Engineering @FEUP
Camera is delayed one frame (Day 066)
Hello there!
Yesterday I watched day 066 and as I was playing the game today, I noticed the camera was delayed 1 frame. I don't know if this has been discussed before or if Casey knows about it but I couldn't find anything on the subject.
So, what I found is that it is delayed because the camera position is only updated on endSim and everything is rendered with positions relative to the camera position in the previous frame (I checked last night's video and I think the bug is still in the code). This bug becomes obvious when using the loop feature and going frame by frame on the debugger (even more if you draw a square in the middle of the screen!).

This is not really important (I don't even know if it is intended or not!), but it is weird that the Hero is not always centered :P
Thank you!
Jason Smith
8 posts
Camera is delayed one frame (Day 066)
It does get brought up in a q&a although I think it's not until day 100 something and for the reason you mentioned.