Handmade Hero » Forums » Code » Camera is delayed one frame (Day 066)
weirdNox
Gonçalo Santos
3 posts

None

#5442 Camera is delayed one frame (Day 066)
1 year, 8 months ago

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!

None
Ciryus33
Jason Smith
6 posts
#5449 Camera is delayed one frame (Day 066)
1 year, 8 months ago

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.