Esempio n. 1
0
        public static void Init()
        {
            GameState = gState.Game;
            GameMenus = new List<Menu>();

            #region MainMenu
                Menu MainMenu = new Menu();
                Menu.Label TitleLabel = new Menu.Label(mainMenuTitle.Text, fPixel, (_2DCraft.wnd.Width / 2), 25);

                TitleLabel.Text.Style = String2D.Styles.Underlined;
                TitleLabel.Text.Size = 30;
                MainMenu.Controls.Add(TitleLabel);
                GameMenus.Add(MainMenu);
            #endregion

            ActiveMenu = MainMenu;

            Ply = new Player("Player", false, new Image(FileSystem.DirectoryPath + "\\" + FileSystem.Directory + "\\" + "textures\\player.png"), 32, 64);

            healthLabel = new Menu.Label("Health: " + Ply.Health, fPixel, 5, _2DCraft.wnd.Height - 20);
            healthLabel.Text.Style = String2D.Styles.Regular;
            healthLabel.Text.Size = 15;
            MainMenu.Controls.Add(healthLabel);

            _2DCraft.MapGen.Init(8, (int)_2DCraft.wnd.Height / 32);
            _2DCraft.MapGen.GenerateMap(0.75, 100);

            Camera = new Camera(0, 0, _2DCraft.wnd.Width, _2DCraft.wnd.Height);

            _2DCraft.wnd.CurrentView = Camera.ViewCamera;
        }
Esempio n. 2
0
 public gInfo(gState state = default, @string name = default, bool isSystemG = default, ref ptr <trace.Event> start = default, ref ptr <trace.Event> markAssist = default)
 {
     this.state      = state;
     this.name       = name;
     this.isSystemG  = isSystemG;
     this.start      = start;
     this.markAssist = markAssist;
 }
Esempio n. 3
0
 public void GoToGameOver()
 {
     GameState = gState.gameover;
     LoadNewScene("gameover");
 }
Esempio n. 4
0
 public void GoToMain()
 {
     GameState = gState.play;
     LoadNewScene("main");
     victory = false;
 }
Esempio n. 5
0
 public void GoToMenu()
 {
     GameState = gState.menu;
     LoadNewScene("menu");
     victory = false;
 }
Esempio n. 6
0
 /// <summary>
 /// 游戏开始
 /// </summary>
 /// <param name="firstTurn"></param>
 public void gameStart(Wuziqi.qiType firstTurn)
 {
     this.firstTurn = firstTurn;
     this.curState  = gState.gaming;
     this._curTurn  = firstTurn;
 }
Esempio n. 7
0
 public orderEvent(ref ptr <Event> ev = default, long batch = default, ulong g = default, gState init = default, gState next = default)
 {
     this.ev    = ev;
     this.batch = batch;
     this.g     = g;
     this.init  = init;
     this.next  = next;
 }
Esempio n. 8
0
 public void Death()
 {
     _player.Playing         = false;
     _player._rb.isKinematic = true;
     _gState = gState.Death;
 }
Esempio n. 9
0
 private void StartGame()
 {
     _player.Playing         = true;
     _player._rb.isKinematic = false;
     _gState = gState.Playing;
 }