public override void AddToManagers() { PlatformerLevel1.AddToManagers(mLayer); HealthPointFactory.Initialize(PositionedObjectListInstance, ContentManagerName); PlayerInstance.AddToManagers(mLayer); base.AddToManagers(); AddToManagersBottomUp(); CustomInitialize(); }
private void RenderHealth() { // Render Health var offset = 1.0f; for (var i = 0; i < Health; i++) { var hp = HealthPointFactory.CreateNew((i * HealthPoint.Width) + offset, 20); HealthList.Add(hp); } }
public override void Destroy() { base.Destroy(); HealthPointFactory.Destroy(); PlatformerLevel1.Destroy(); PlatformerLevel1 = null; PositionedObjectListInstance.MakeOneWay(); if (PlayerInstance != null) { PlayerInstance.Destroy(); PlayerInstance.Detach(); } for (int i = PositionedObjectListInstance.Count - 1; i > -1; i--) { PositionedObjectListInstance[i].Destroy(); } PositionedObjectListInstance.MakeTwoWay(); CustomDestroy(); }