/// <summary>
        /// Sets up several default values for the gameview.
        /// </summary>
        public override void GameInitialize()
        {
            // Set the required values
            GAME_ENGINE.SetTitle($"Missile Command {Registers.version}");
            GAME_ENGINE.SetIcon("icon.ico");

            // Set the optional values
            GAME_ENGINE.SetScreenWidth(Registers.ScreenWidth);
            GAME_ENGINE.SetScreenHeight(Registers.ScreenHeight);
            GAME_ENGINE.SetBackgroundColor(0, 0, 0); //Appelblauwzeegroen
            //GAME_ENGINE.SetBackgroundColor(49, 77, 121); //The Unity background color
        }
Beispiel #2
0
        public override void GameInitialize()
        {
            // Set the required values
            GAME_ENGINE.SetTitle("Canvas v1.1.1");
            GAME_ENGINE.SetIcon("icon.ico");

            // Set the optional values
            GAME_ENGINE.SetScreenWidth(640);
            GAME_ENGINE.SetScreenHeight(240);
            GAME_ENGINE.SetBackgroundColor(0, 167, 141); //Appelblauwzeegroen
            //GAME_ENGINE.SetBackgroundColor(49, 77, 121); //The Unity background color
        }
Beispiel #3
0
        public override void GameInitialize()
        {
            // Set the required values
            GAME_ENGINE.SetTitle("League of Advanture");
            GAME_ENGINE.SetIcon("icon.ico");

            // Set the optional values
            GAME_ENGINE.SetWidth(1280);
            GAME_ENGINE.SetHeight(768);
            //GAME_ENGINE.SetBackgroundColor(0, 167, 141); //Appelblauwzeegroen
            GAME_ENGINE.SetBackgroundColor(49, 77, 121); //The Unity background color
        }
        public override void Paint()
        {
            //If there's an error don't show anything else, in any class that needs to change values each frame and other drae functions
            if (Registers.gameState != GameState.Error)
            {
                GAME_ENGINE.SetBackgroundColor(0, 0, 0);
                GAME_ENGINE.SetColor(0, 0, 0);
                if (destroyedCities == 6)
                {
                    Registers.gameState = GameState.Stopped;
                }
                if (Registers.gameState == GameState.Paused)
                {
                    //Draw pause menu
                    //DISABLED as it hasn't been completed

                    /*int h = 0;
                     * for (int ij = 0; ij < ImageData.PauseMenu.Length; ij++)
                     * {
                     *  if (ImageData.PauseMenu[ij] == 0x00)
                     *  {
                     *      GAME_ENGINE.SetColor(255, 255, 255);
                     *      //GAME_ENGINE.FillRectangle(rec_landscape);
                     *  }
                     *  else
                     *  {
                     *      try
                     *      {
                     *          //Draw pixel based on color data in array
                     *          GAME_ENGINE.SetColor(ImageData.PauseMenu[ij], ImageData.PauseMenu[ij + 1], ImageData.PauseMenu[ij + 2]);
                     *          GAME_ENGINE.FillRectangle(rec_pausemenu);
                     *      }
                     *      catch (Exception e)
                     *      {
                     *          //This should NOT trigger, unless you f*cked something up
                     *          Console.WriteLine(string.Format("Okay, you f*cked something up {0}", e));
                     *          error_reason = new Exception($" {e}, Something ran into some problems which shouldn't happen");
                     *          Registers.gameState = GameState.Error;
                     *      }
                     *  }
                     *  rec_pausemenu.X += 8;
                     *  h++;
                     *  if (h >= 40)
                     *  {
                     *      Pausemenu_line++;
                     *      rec_pausemenu.Y += PausemenuScale;
                     *      rec_pausemenu.X = Registers.ScreenWidth * 0.5f - PausemenuScale;
                     *      h = 0;
                     *  }
                     *  //Console.WriteLine(string.Format("i: {0}, h: {1}, draw X: {2}", i, h, rec_pausemenu.X));
                     *  //Skip over other color data (G & B of RGB)
                     *  ij += 2;
                     * }*/
                }
                GAME_ENGINE.SetScale(8.5f, 8);
                GAME_ENGINE.DrawBitmap(landscape_bit, new Vector2f((float)(Registers.ScreenWidth * 0.5 - landscape_bit.GetWidth() * 4 - 0.025 * Registers.ScreenWidth), (float)(Registers.ScreenHeight * 0.5 - landscape_bit.GetHeight() * 4 + 0.46 * Registers.ScreenHeight)));
                GAME_ENGINE.SetScale(1, 1);

                GAME_ENGINE.SetColor(255, 255, 255);
                if (destroyedCities == 6)
                {
                    Registers.gameState = GameState.Stopped;
                    loseFont.SetHorizontalAlignment(Font.Alignment.Center);
                    loseFontMedium.SetHorizontalAlignment(Font.Alignment.Center);
                    GAME_ENGINE.SetColor(190, 0, 0);
                    GAME_ENGINE.DrawString(loseFont, "You lose", rec_lose);
                    GAME_ENGINE.DrawString(loseFontMedium, "Press Esc to exit", rec_exitText);
                    GAME_ENGINE.SetColor(0, 0, 0);
                }

                rec_landscape.X = LandscapeX;
                rec_landscape.Y = LandscapeY;
                rec_pausemenu.X = Registers.ScreenWidth * 0.5f - PausemenuScale;
                rec_pausemenu.Y = Registers.ScreenHeight * 0.5f - PausemenuScale;
                rec_crosshair.X = Registers.CrosshairX;
                rec_crosshair.Y = Registers.CrosshairY;


                GAME_ENGINE.DrawEllipse(rec_crosshair, 2);
                return;
            }
            GAME_ENGINE.SetBackgroundColor(200, 0, 30);
            GAME_ENGINE.SetColor(255, 255, 255);
            GAME_ENGINE.DrawString(errorFontM, "An Error has occured", rec_errorM);
            if (error_reason == null)
            {
                error_reason = new Exception("Error Screen triggered");
            }
            string err = error_reason.ToString();


            //GAME_ENGINE.DrawString(errorFont, string.Format("{0}", Regex.Replace(err, err_pattern, "")), rec_error);
            GAME_ENGINE.DrawString(errorFont, string.Format("{0}", err), rec_error);
            GAME_ENGINE.SetColor(0, 0, 0);
        }