コード例 #1
0
        public override void LoadContent()
        {
            GridDraw.LoadContent();
            base.LoadContent();

            LightAOE.LoadContent();
            MagnetAOE.LoadContent();
        }
コード例 #2
0
        static int MainMenu()
        {
            Console.WriteLine("----GAME SETTINGS----\n");
            Console.WriteLine("Map Size? (Enter number less than 100)\n");
            string userSizeString = Console.ReadLine();
            int    userSizeInput  = Int32.Parse(userSizeString);

            if (userSizeInput > 100)
            {
                Console.WriteLine($"Height Entered: {userSizeInput} is invalid. Must be less than 100.");
                return(0);
            }
            Console.WriteLine($"Creating Space Grid of ( {userSizeInput} x {userSizeInput} )\n");

            spaceGrid mainGrid = new spaceGrid(userSizeInput, userSizeInput);

            // Create Player, add them to a list (of 1, currently)
            Player        mainPlayer = new Player();
            List <Player> playerList = new List <Player>(1);

            playerList.Add(mainPlayer);

            //Instantiate and apply a default environment
            //TODO: Make environments do things.
            SpaceGame.EnvironmentModifiers.Environment defaultEnv = new SpaceGame.EnvironmentModifiers.Environment();

            //Create new GameSentinel Object (Game arena) using the provided grid settings, PlayerList, and EnvironmentVariables.

            GameSentinel mainSentinel = new GameSentinel(mainGrid, defaultEnv, playerList);

            //Test DrawShipGrid, since I can't make it work with unit tests.

            int TermConfirm = -1;

            do
            {
                GridDraw.DrawShipGrid(mainGrid);
                int TermSignal = GameSentinel.PerformTurn(mainSentinel);
                TermConfirm = TermSignal;
            } while (TermConfirm != 0);

            Console.WriteLine("Exiting game!");

            return(0);
        }
コード例 #3
0
 public Camera(GridDraw grid, IMyCameraBlock cam)
 {
     Grid = grid;
     Cam  = cam;
 }
コード例 #4
0
 void OnTriggerEnter(Collider other)
 {
     bounds = GameObject.Find("GridDraw").GetComponent <GridDraw>();
     //Destroy(other.gameObject);
     StartCoroutine(respawnCube(other));
 }