public void Init(ContentManager Content, Score S) { CurentState = MenuState.main; bgmenu = Content.Load<Texture2D>("mainmenu2"); this.font = Content.Load<SpriteFont>("lightgamefont"); this.SCORE = S; MainBtn = new List<Button>(); ControlerBtn = new List<Button>(); Play = new Button(); Play.Init(new Vector2(350, 150), Content.Load<Texture2D>("btnplay"), 300, 50); MainBtn.Add(Play); Score = new Button(); Score.Init(new Vector2(350, 250), Content.Load<Texture2D>("btnscore"), 300, 50); MainBtn.Add(Score); Controler = new Button(); Controler.Init(new Vector2(350, 350), Content.Load<Texture2D>("btnster"), 300, 50); MainBtn.Add(Controler); Exit = new Button(); Exit.Init(new Vector2(350, 450), Content.Load<Texture2D>("btnexit"), 300, 50); MainBtn.Add(Exit); Arrows = new Button(); Arrows.Init(new Vector2(200, 250), Content.Load<Texture2D>("controlerkey"), 250, 250); Arrows.Set(); ControlerBtn.Add(Arrows); Signal = new Button(); Signal.Init(new Vector2(550, 250), Content.Load<Texture2D>("controlersignal"), 250, 250); ControlerBtn.Add(Signal); }
protected override void Initialize() { font = Content.Load<SpriteFont>("gamefont"); SCORE = new Score(); Menu = new MainMenu(); Menu.Init(this.Content, SCORE); player = new Plane(); enemies = new List<Enemy>(); explosions = new List<Animations>(); tree = new List<tree>(); random = new Random(); this.rotationPlane = -0.3f; previousSpawnTime = TimeSpan.Zero; enemySpawnTime = TimeSpan.FromSeconds(3.0f); previousTreeSpawnTime = TimeSpan.Zero; treeSpawnTime = TimeSpan.FromSeconds(2.0f); score = 0; Score = 0; CurrentGameState = GameState.MainMenu; CurrentController = GameController.Arrow; IsMouseVisible = true; // RADIO Radio = new _RadioControl(); if (Radio.CheckPorts().Length != 0) { Radio.CreatPort(Radio.CheckPorts()[0]); Thread oThread = new Thread(new ThreadStart(Radio.ListeningSignal)); oThread.Start(); Radio.SetMin(); } this.Go = false; base.Initialize(); }