glue-reference-entities-destroy
Introduction
Understanding when to call Destroy
What does Destroy modify/do?
Referencing Destroyed Entities
// This assumes that Enemy is a valid Entity type and that this code is written in a Screen's custom code:
// First create the Enemy
Enemy enemyInstance = new Enemy(ContentManagerName);
// Then destroy it
enemyInstance.Destroy();
// At this point the game will not show enemyInstance; however enemyInstance is still a valid reference:
enemyInstance.X = 4;
// This will set otherEnemyInstance's X to 4
otherEnemyInstance.X = enemyInstance.X;Last updated
Was this helpful?