コード例 #1
0
        /// <summary>
        /// Main Function, main acces point for the program
        /// </summary>
        public static void Main()
        {
            GameObjects.Polyhedra.Add(new A9(35));

            GameObjects.Polyhedra[0].Offset(new Vector(80, 80));
            //Open the game window
            SwinGame.OpenGraphicsWindow(Title + " v" + Version, 800, 600);

            //SwinGame.ToggleFullScreen();
            //SwinGame.ShowSwinGameSplashScreen();

            //Load the game assets
            GameResources.LoadResources();

            GameScores.Initalise();

            //Run the game loop
            while (false == SwinGame.WindowCloseRequested())
            {
                //Fetch the next batch of UI interaction
                SwinGame.ProcessEvents();

                InputController.ProcessMovement();

                //Clear the screen and draw the framerate
                SwinGame.ClearScreen(Color.Black);

                SwinGame.DrawFramerate(0, 0);

                if (SwinGame.KeyDown(KeyCode.vk_z))
                {
                    GameObjects.Polyhedra[0].Scale(1.01);
                }
                if (SwinGame.KeyDown(KeyCode.vk_x))
                {
                    GameObjects.Polyhedra[0].Scale(0.99);
                }


                //Update Game

                GameObjects.Draw(Color.Goldenrod, Color.DarkGoldenrod);

                tick++;

                //Draw onto the screen
                SwinGame.RefreshScreen(60);
            }

            GameResources.FreeResources();
        }
コード例 #2
0
        /// <summary>
        /// main
        /// the main entry point for the program
        /// </summary>
        public static void Main()
        {
            //Open the game window
            SwinGame.OpenGraphicsWindow(Title + " v" + Version, 800, 600);

            GameResources.LoadResources();
            GameScores.Initalise();
            GameObjects.Player = new PlayerEntity(PlayerType.NarrowA);

            //Run the game loop
            while (false == SwinGame.WindowCloseRequested())
            {
                RandomPlacementOfItems();

                SwinGame.ClearScreen(Color.Grey);
                SwinGame.DrawRectangle(Color.DarkGray, true, 40, 20, 460, 560);

                SwinGame.ProcessEvents();

                GameObjects.Player.ProcessEvents();

                foreach (ItemEntity item in GameObjects.Items)
                {
                    item.ProcessEvents();
                }

                SwinGame.DrawBitmap(GameResources.GameImage("GameArea"), 0, 0);
                SwinGame.DrawText("Score: " + GameScores.Score, Color.Black, 540, 40);
                SwinGame.DrawText("Lives: " + GameScores.Player, Color.Black, 540, 60);
                SwinGame.DrawText("Bombs: " + GameScores.Bomb, Color.Black, 540, 80);
                SwinGame.DrawText("Power: " + GameScores.Power, Color.Black, 540, 120);
                SwinGame.DrawText("Graze: " + GameScores.Graze, Color.Black, 540, 140);
                SwinGame.DrawText("Bonus: " + GameScores.Bonus, Color.Black, 540, 160);

                SwinGame.DrawFramerate(0, 0);

                tick++;

                SwinGame.RefreshScreen(60);
            }
            GameResources.FreeResources();
        }
コード例 #3
0
        /// <summary>
        /// Main Function, main acces point for the program
        /// </summary>
        public static void Main()
        {
            //Open the game window
            SwinGame.OpenGraphicsWindow(Title + " v" + Version, 800, 600);

            //SwinGame.ToggleFullScreen();
            //SwinGame.ShowSwinGameSplashScreen();

            //Load the game assets
            GameResources.LoadResources();

            GameScores.Initalise();
            GameObjects.Initalise();

            //Run the game loop
            while (false == SwinGame.WindowCloseRequested() && GameScores.Player != 0)
            {
                //Fetch the next batch of UI interaction
                SwinGame.ProcessEvents();

                //Clear the screen and draw the framerate
                SwinGame.ClearScreen(Color.Grey);
                SwinGame.DrawRectangle(Color.DarkGray, true, 40, 20, 460, 560);


                SwinGame.DrawFramerate(0, 0);

                //Update Game
                GameObjects.ProcessEvents();

                RandomPlacementOfItems();

                tick++;
                //Draw onto the screen
                SwinGame.RefreshScreen(60);
            }

            GameResources.FreeResources();
        }