Right now I'm working with dynamic event spawning on the map.
I could always pre-create some static events and then just move them around as needed, but if I want the event to be spawned in any map, I'd rather just keep the event in one "set up" map and then just generate a new event using that as a template.
Ok, so creating a new event involves picking an ID. I could probably safely assume the length of the event list + 1, unless I'm really generating a lot of events and I hit some limit.
Once an ID is picked, I just need to create a Game_Event object and then assign it to the array of events.
Now, how would I have the spriteset know to draw it?
The spriteset is held by the current scene
1. I could have a method in Spriteset_Map constantly poll the map for any new events that need to be added.
2. I could have tell SceneManager to tell the current scene to call a certain method in the current spriteset.
3. I could explicitly access the current scene through the SceneManager and tell the spriteset to do something (which is like #2 except I'm being more intrusive)
For me, #2 makes the most sense. The SceneManager is in charge of managing the scene, so if I need the scene to do something, I can go tell the scene manager to do it.
I don't like #1 because polling requires constant resource use, and "event spawning" should ideally just fire a trigger that sends a new task to the spriteset, and it's up to the spriteset to determine whether there are any tasks to do.
However, this means that the spriteset is still going to be polling its own list of tasks to do, which is no different from just having it poll the map for any changes in the first place (maybe a bit better in design)
Having the map create a new event is easy, but how should I tell the spriteset to generate new sprites?
I could always pre-create some static events and then just move them around as needed, but if I want the event to be spawned in any map, I'd rather just keep the event in one "set up" map and then just generate a new event using that as a template.
Ok, so creating a new event involves picking an ID. I could probably safely assume the length of the event list + 1, unless I'm really generating a lot of events and I hit some limit.
Once an ID is picked, I just need to create a Game_Event object and then assign it to the array of events.
Now, how would I have the spriteset know to draw it?
The spriteset is held by the current scene
1. I could have a method in Spriteset_Map constantly poll the map for any new events that need to be added.
2. I could have tell SceneManager to tell the current scene to call a certain method in the current spriteset.
3. I could explicitly access the current scene through the SceneManager and tell the spriteset to do something (which is like #2 except I'm being more intrusive)
For me, #2 makes the most sense. The SceneManager is in charge of managing the scene, so if I need the scene to do something, I can go tell the scene manager to do it.
I don't like #1 because polling requires constant resource use, and "event spawning" should ideally just fire a trigger that sends a new task to the spriteset, and it's up to the spriteset to determine whether there are any tasks to do.
However, this means that the spriteset is still going to be polling its own list of tasks to do, which is no different from just having it poll the map for any changes in the first place (maybe a bit better in design)
Having the map create a new event is easy, but how should I tell the spriteset to generate new sprites?
