Cloning: Difference between revisions

1 byte removed ,  10 September 2018
m
no edit summary
m (fixing links)
mNo edit summary
Line 46: Line 46:
Some objects such as coins and goombas use spawners, whose purpose is to ensure that these objects are loaded when necessary. For example, when Mario moves far away from a line of coins, they despawn. When Mario again moves toward the coins, the coin line's spawner is responsible for respawning the coins in the line that have not yet been collected.
Some objects such as coins and goombas use spawners, whose purpose is to ensure that these objects are loaded when necessary. For example, when Mario moves far away from a line of coins, they despawn. When Mario again moves toward the coins, the coin line's spawner is responsible for respawning the coins in the line that have not yet been collected.


When Mario interacts with a coin, he collects it and sets a flag on the coin to inform it that it has been collected. When the coin next updates, it despawns itself, and informs the coin spawner that it should not be respawned when Mario moves away and comes back. However, if this coin was cloned, then it does not update, and so cannot inform the spawner that it has been collected. Thus, if Mario collects a cloned coin, and then moves away and returns, the original coin will respawn, effectively duplicating the coin.
When Mario interacts with a coin, he collects it and sets a flag on the coin to inform it that it has been collected. When the coin next updates, it despawns itself and informs the coin spawner that it should not be respawned when Mario moves away and comes back. However, if this coin was cloned, then it does not update, and so cannot inform the spawner that it has been collected. Thus, if Mario collects a cloned coin, and then moves away and returns, the original coin will respawn, effectively duplicating the coin.


The following objects can be duplicated in this manner:
The following objects can be duplicated in this manner: