Exemple #1
0
        private void AddGhost(string TextureName)
        {
            MonogameGhost gm = new MonogameGhost(Game, this);

            gm.strGhostTexture = TextureName;
            gm.Initialize();
            gm.Direction = gm.GetRandomDirection();
            gm.Location  = gm.GetRandomLocation();
            gm.SetTranformAndRect();

            foreach (MonogameGhost otherGhost in Ghosts)
            {
                while (gm.Intersects(otherGhost))
                {
                    gm.Location = gm.GetRandomLocation();
                    gm.SetTranformAndRect();
                }
            }
            gm.Scale   = 1.0f;
            gm.Enabled = true;
            gm.Visible = true;
            Ghosts.Add(gm);
        }
Exemple #2
0
 protected void RemoveGhost(MonogameGhost mg)
 {
     this.Ghosts.Remove(mg);
 }