I want my game engine to be able to handle MANY different sprites in the viewing screen. (Upwards of 200+) I haven't gotten it into code yet, but from theory, how efficient would this be to display all the sprites?
CODE
In the painting method, a list of every button, icon, sprite, tilepiece, particle, and scenery would be sorted into lists.
Let's use this button array as an example: (May be more or less, 100 is just an example)
public Button(100) buttons;
Each button has a certain script that the game engine interprets so that each button has an associated action.
Each button contains a link to an image in my resources.
If the paint method looked something like this psuedocode (below), would it be able to handle the many sprites that may be displayed?
public void Paint()
{
for int i= 0 to buttons.length,
{
draw(buttons(i).img);
i++;
}
This code is the first design I came up with. I DO plan to add priority to certain sprites in need of updating.
But say that the code involves priority for certain sprites, could doing a systematic 'for each' sprite be efficient?
Let's use this button array as an example: (May be more or less, 100 is just an example)
public Button(100) buttons;
Each button has a certain script that the game engine interprets so that each button has an associated action.
Each button contains a link to an image in my resources.
If the paint method looked something like this psuedocode (below), would it be able to handle the many sprites that may be displayed?
public void Paint()
{
for int i= 0 to buttons.length,
{
draw(buttons(i).img);
i++;
}
This code is the first design I came up with. I DO plan to add priority to certain sprites in need of updating.
But say that the code involves priority for certain sprites, could doing a systematic 'for each' sprite be efficient?
I know this is a lot, but please read carefully.
~~Samarkov
