(Pseudo code)
- Code: Select all • Expand view
//Creates the actor in memory only
//Usder can assign needed properties here
Shells shelly = new Shells();
//Puts thing on map. User can set it's position afterwards.
map.addChild(shelly);
//Takes it out of the map but does not remove from memory.
//Properties of this actor remain persistent until deleted or whatever
map.removeChild(shelly);
The exact wording of it isn't important, but I imagine it would be a lot easier for thing manipulation if on adding/removal, you wouldn't have to dedicate a separate class/struct to track it's info and have to rely on thing.destroy() and then spawning a whole new actor when the user needs to re-summon it, or rely on hacky tricks like teleporting the actor way outside the map to hide it.