What do you think is the most efficient way to deal with multiple types of object/AI on the NES? I can think of a couple different ways to do so, but I'm not sure which one is the best, most efficient, or most common, etc. Here are the ways I can think of off the top of my head:
1. Have a subroutine for each category of object that deals with updating (and generally dealing with) all objects of a given type. Eg: updates all bouncing balls every frame.
2. Have a subroutine that updates a single object which is jumped to based on information about the object held in RAM. Eg: bouncing balls have a RAM variable "AI" that specifies which subroutine to call to deal with the individual ball.
3. Have a subroutine that deals with all objects of a given type, but this subroutine calls a second subroutine which actually updates the individual objects. Eg: updates all bouncing balls every frame by calling a sub that updates an individual ball for each ball present in the game world.
What do you use, and what do you think is the most efficient for the NES?
1. Have a subroutine for each category of object that deals with updating (and generally dealing with) all objects of a given type. Eg: updates all bouncing balls every frame.
2. Have a subroutine that updates a single object which is jumped to based on information about the object held in RAM. Eg: bouncing balls have a RAM variable "AI" that specifies which subroutine to call to deal with the individual ball.
3. Have a subroutine that deals with all objects of a given type, but this subroutine calls a second subroutine which actually updates the individual objects. Eg: updates all bouncing balls every frame by calling a sub that updates an individual ball for each ball present in the game world.
What do you use, and what do you think is the most efficient for the NES?