Пример #1
0
        private void InitializeEntities()
        {
            // Place kits
            kits = EntitiesInitializer.InitKits(width, height, pointSize);

            // Place the player
            player = EntitiesInitializer.InitPlayer(width, height, pointSize, kits.Position);

            // Create the bombs array
            var exceptionsNearNotAllowed = new Point[] { player.Position, kits.Position, endPoint };

            bombs = EntitiesInitializer.InitBombs(width, height, pointSize, exceptionsNearNotAllowed: exceptionsNearNotAllowed).ToArray();
        }
Пример #2
0
        public static Player_CT InitPlayer(int width, int height, int pointSize, params Point[] toIgnore)
        {
            Player_CT player;

            do
            {
                player = new Player_CT(
                    rnd.Next(1, (width - pointSize) / pointSize) * pointSize,
                    height - pointSize
                    );
            } while (toIgnore?.Contains(player.Position) ?? false);

            return(player);
        }