psycopathicteen wrote:
Have you ever posted a demo? I want to see Sonic on the NES.
No, I never got past the stage of backgrounds made of colored boxes and dumb objects that are moved around without physics. Nothing particularly interesting to see.
thefox wrote:
For example, if object-object collisions are done by checking for bounding box overlap, the player's bounding box could be precalculated (no need to calculate it again for each enemy).
Yes, that's something I considered, but never got to implement.
Quote:
When it comes the time to draw the player in the object loop though, do you draw it with the previous frames coordinates? I think you'd need to save a copy of the previous frames coordinates specifically for player in that case.
I believe I did, but things are indeed fading from memory...
Sik wrote:
You should update the camera position at the end, after all the objects have been processed (especially if there's anything else that could affect the camera position besides the player - e.g. a boss that brings attention to itself to make it easier to see what's going on).
Ideally, yes, but that would require a second pass over the objects in order to draw them afterwards. This is the NES, where each CPU cycle is worth gold if you're trying to code something that can compare to 16-bit games, so the goal is to iterate over the objects only once, and do the AI and the drawing in one go, and the camera position has to be final so that sprites can be drawn.
A 1 frame delay in the camera in a game running at 60Hz should be unnoticeable. I was counting on it! =)