public void Init() { if (Singleton == null) { Singleton = this; } else { IO.Debug.Log("The EntityManager Singleton was not null"); } enemies = new List <Enemy>(); mainBullletObject = new Bullets.BulletObject(1024, false); }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public void DoCollisionsWithBullets(Bullets.BulletObject bullets) { if (bullets.CollidesWithEnemies) { for (int i = 0; i < bullets.Count; i++) { // TODO: do collision } } else { for (int i = 0; i < bullets.Count; i++) { // TODO: do collision } } }
public void RenderBullet(BulletObject bob) { for (int i = 0; i < bob.Count; i++) { switch (bob[i].drawType) { case BulletDraw.Circle: DrawBullet_Circle(ref bob[i]); break; case BulletDraw.FireBall: DrawBullet_Fireball(ref bob[i]); break; default: break; } } }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Check the BulletType and call the corisponding update/render function public void UpdateBullet(BulletObject bob, float delta) { // Find and call the correct function for this bullet for (int i = 0; i < bob.Count; i++) { if (bob[i].logicType == BulletLogic.None) { continue; } bob[i].TimeSinceAwake += delta; switch (bob[i].logicType) { case BulletLogic.MoveLinear: UpdateBullet_Linear(ref bob[i], delta); break; case BulletLogic.MoveRadial: UpdateBullet_Radial(ref bob[i], delta); break; default: break; } } }