Hello guys, What should I do if there is an object that would be repeated multiple times in the same screen. You can't put it more than once, right? And I wouldn't like making clones of the object and wasting memory, as it is a scarce resource...
What should I do if there is an object that would be repeated multiple times in the same screen
Each object is pointed specifically to a screen including its x/y coordinates, in order to let the detection when the player passes over. So it isn't possible to point the same object multiple times in the map; a memory "waste" in this case is necessary, you have to crate more objects with the same design.
There's a trick to let an object reappear elsewhere (same room or different room) once collected, that is "virtually" moving the player to the new location (you'll need a couple of coordinates to use as player's x/y mirrors), put down the object and restoring the player x/y coordinates to the original values. This operation will be "invisible" so you won't see the player movement, just the same object when you'll enter the new location.