static void Main() { Present.ConsoleDebugging ConsoleControl = new Present.ConsoleDebugging(); ConsoleControl.ClouseWindow(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //Экран загрузки с таймером StartScreen TimerPage = new StartScreen(); DateTime Time = DateTime.Now + TimeSpan.FromSeconds(3); while (Time > DateTime.Now) { Application.DoEvents(); } TimerPage.Close(); TimerPage.Dispose(); //Меню OutFirstForm ForFirtsApp = new OutFirstForm { DinamicChoiseBool = false, FileNameBrain = null, LearningFactor = 3, NumberBotInt = 50 }; MenuForm FirstApp = new MenuForm(ForFirtsApp); Application.Run(FirstApp); ForFirtsApp = FirstApp.OUT_DATA; FirstApp.Dispose(); //Главная форма MainForm SecondApp = new MainForm(ForFirtsApp, ConsoleControl); Application.Run(SecondApp); SecondApp.Dispose(); }
public static void EndScreenHighScores(BigInteger score) { try { StreamReader read = new StreamReader("HighScores.txt"); Console.Clear(); Console.SetCursorPosition(5, 20); Console.Write("You entered top 9 player. Enter your name: "); bool canAdd = true; Dictionary <string, BigInteger> players = new Dictionary <string, BigInteger>(); string readLine; using (read) { readLine = read.ReadLine(); readLine = read.ReadLine(); while (readLine != null) { string[] player = readLine.Split(new char[] { ' ', ',', '|' }, StringSplitOptions.RemoveEmptyEntries); players.Add(player[1], BigInteger.Parse(player[2])); if (score > BigInteger.Parse(player[2])) { canAdd = true; } readLine = read.ReadLine(); } } if (players.Count < 9 || canAdd) { StringBuilder playerName = new StringBuilder(); int length = 0; while (true) { if (Console.KeyAvailable) { EnterName(ref score, ref players, playerName, ref length); } } } } catch (FileNotFoundException) { Console.Clear(); Console.SetCursorPosition(5, 20); Console.Write("You entered top 9 player. Enter your name: "); Dictionary <string, BigInteger> players = new Dictionary <string, BigInteger>(); StringBuilder playerName = new StringBuilder(); int length = 0; EnterName(ref score, ref players, playerName, ref length); while (Console.ReadKey().Key != ConsoleKey.Escape) { Console.SetCursorPosition(0, Console.CursorTop); Console.Write(' '); Console.SetCursorPosition(0, Console.CursorTop); } StartScreen.Main(); } }
public Screens() { Home = new Home(); Alarms = new Alarms(); Settings = new Settings(); StartScreen = new StartScreen(); }
void Awake() { Client.GameStarted += StartGame; CurrentMenu = StartScreen.Instance(); CurrentContextMenu = EmptyContextMenu.Instance(); State = GameState.START_SCREEN; MaximumPlayers = StartPoints.Count; FieldWidth = fieldwidth; FieldHeight = fieldheight; GroundWidth = groundwidth; GroundHeight = groundheight; Players = players; Field.Width = FieldWidth; Field.Height = FieldHeight; Ground.Width = GroundWidth; Ground.Height = GroundHeight; StartPoints.Add(new Point(0 - (Ground.Width / 2), 0 - (Ground.Height / 2))); StartPoints.Add(new Point(0 - (Ground.Width / 2), (Ground.Height / 2) - 1)); StartPoints.Add(new Point(Ground.Width / 2, Ground.Height / 2)); StartPoints.Add(new Point(Ground.Width / 2, 0 - ((Ground.Height / 2) - 1))); Rectangles.Add(new Rect(0 - Ground.Width / 2, 0 - Ground.Height / 2, Ground.Width, Ground.Height)); Rectangles.Add(new Rect(0 - Field.Width / 2, 0 - Field.Height / 2, Field.Width, Field.Height)); SpellList.Add(Fireball.Instance()); SpellList.Add(Blink.Instance()); }
protected override void LoadContent() { _gamePlaySong = Content.Load <Song>("Sounds\\battle"); _menuSong = Content.Load <Song>("Sounds\\menu_song2"); _dead = Content.Load <Song>("Sounds\\defeat"); MediaPlayer.IsRepeating = true; MediaPlayer.Play(_menuSong); _menuClickSelected = Content.Load <SoundEffect>("Sounds\\button-25"); _spriteBatch = new SpriteBatch(GraphicsDevice); _gameIsOn = false; SetScreenSize(); _gameOverScreen = new GameOverScreen(this, _spriteBatch, Content.Load <SpriteFont>("menufont"), Content.Load <Texture2D>("gameover_screen")); Components.Add(_gameOverScreen); _gameOverScreen.Hide(); _startScreen = new StartScreen(this, _spriteBatch, Content.Load <SpriteFont>("menufont"), Content.Load <Texture2D>("splash_screen")); Components.Add(_startScreen); _startScreen.Hide(); _actionScreen = new ActionScreen(this, _spriteBatch, Content.Load <Texture2D>("Levels\\level1_background")); Components.Add(_actionScreen); _actionScreen.Hide(); //_activeScreen = _gameOverScreen; //_gameOverScreen.SetScoreText(); _activeScreen = _startScreen; _activeScreen.Show(); }
void StartState(GameState pGameState) { switch (pGameState) { case GameState.STARTSCREEN: _startScreen = new StartScreen(this); AddChild(_startScreen); break; case GameState.OPENINGSCREEN: _openingScreen = new OpeningScreen(this); AddChild(_openingScreen); break; case GameState.LEVEL: _level = new Level(this); _player = _level.GetPlayer(); AddChild(_level); break; case GameState.LOSESCREEN: _loseScreen = new LoseScreen(this, _player); AddChild(_loseScreen); break; case GameState.WINSCREEN: _winScreen = new WinScreen(this, _player); AddChild(_winScreen); break; default: break; } }
// Use this for initialization void Start() { audioSource = GetComponent <AudioSource>(); start = Resources.FindObjectsOfTypeAll <StartScreen>()[0]; fadeOutAudio = false; startPlaying = true; }
private Crosshair cs;// = new Crosshair(); public MyGame() : base(1920, 1080, false) { gd = new GunDude(); gm = new GameManager(); border = new Border(); background = new Background(); smoke = new Smoke(); lights = new Lights(); cs = new Crosshair(); hud = new HUD(); player = new Player(); builder = new WaveBuilder(); topBuilder = new TopWaveBuilder(); startScreen = new StartScreen(); gameOver = new GameOver(); gameObjs.Add(border); gameObjs.Add(background); gameObjs.Add(smoke); gameObjs.Add(lights); gameObjs.Add(cs); gameObjs.Add(hud); gameObjs.Add(player); gameObjs.Add(gd); builder.WaveSpawner(); topBuilder.WaveSpawner(); }
public void newGame() { GameObject startScreenobj = Instantiate(startScreen, new Vector3(0, 0, 0), Quaternion.identity) as GameObject; StartScreen ss = startScreenobj.gameObject.GetComponent <StartScreen>(); ss.controller = gameObject.GetComponent <GameController>(); }
/// <summary> /// Sets up the frame for the tactile user interface output. /// </summary> private void setUpTui() { if (io != null) { // get the current active Adapter and get its dimensions // this is necessary to create content regions in correct size int width = 120; int height = 60; // get the dimensions of the current active devices' display area getActiveAdapterDimensions(ref width, ref height); // create the main screen - a container for content regions gameScreen = new GameScreen(ll, width, height); startScreen = new StartScreen(ll, width, height); mainMenuScreen = new MenuScreen("MainMenu", mainMenuModel, 2, 2, width - 4, 8); pauseMenuScreen = new MenuScreen("PauseMenu", pauseMenuModel, 2, 2, width - 4, 8); saveMenuScreen = new MenuScreen("SaveMenu", saveMenuModel, 2, 2, width - 4, 8); loadMenuScreen = new MenuScreen("LoadMenu", loadMenuModel, 2, 2, width - 4, 8); questionScreen = new MenuScreen("QuestionMenu", null, 0, 0, width, 13); gameScreen.Register(); startScreen.Register(); mainMenuScreen.Register(); saveMenuScreen.Register(); loadMenuScreen.Register(); pauseMenuScreen.Register(); questionScreen.Register(); } }
public static SceneObject Create(SceneState _scene) { SceneObject scene = null; switch (_scene) { case SceneState.StartScreen: scene = new StartScreen(); break; case SceneState.Level1: scene = new Level1(); break; case SceneState.Level2: scene = new Level2(); break; case SceneState.Level3: scene = new Level3(); break; case SceneState.Level4: scene = new Level4(); break; case SceneState.SummaryScreen: scene = new SummaryScreen(); break; default: return(null); } return(scene); }
protected override void CreateScreens() { SymbolImport si = new SymbolImport("titleScreen", "entryScreen"); titleScreen = new StartScreen(si); stage.AddScreen(titleScreen); levelNumber = 12; //AddLevel("allCarsScreen", typeof(AllCarsScreen)); //AddLevel("wideBoulevardScreen", typeof(WideBoulevardScreen)); //AddLevel("spaceMediumScreen", typeof(SpaceMediumScreen)); //AddLevel("steamRollerScreen", typeof(SteamRollerScreen)); levelNumber = 0; AddLevel("twoLaneScreen", typeof(TwoLaneScreen)); // must be first AddLevel("wideBoulevardScreen", typeof(WideBoulevardScreen)); AddLevel("crosswalkScreen", typeof(CrosswalkScreen)); AddLevel("twoTrainTwoRestScreen", typeof(TwoTrainTwoRestScreen)); AddLevel("twoCanaltwoBoulScreen", typeof(TwoCanalTwoBoulevardScreen)); AddLevel("spaceMediumScreen", typeof(SpaceMediumScreen)); AddLevel("allCarsScreen", typeof(AllCarsScreen)); AddLevel("twoCanalScreen", typeof(TwoCanalScreen)); AddLevel("housesScreen", typeof(HousesScreen)); AddLevel("allWaterScreen", typeof(AllWaterScreen)); AddLevel("twoTrainScreen", typeof(TwoTrainScreen)); AddLevel("allTrainScreen", typeof(AllTrainScreen)); AddLevel("laneChangeScreen", typeof(LaneChangeScreen)); // must be 12th AddLevel("twoCanalTwoTrainScreen", typeof(TwoCanalTwoTrainScreen)); AddLevel("twoBoulevardScreen", typeof(TwoBoulevardScreen)); AddLevel("steamRollerScreen", typeof(SteamRollerScreen)); }
public void hookUpInterface() { inGameScreen = new inGame(ref p1); charCreation = new CharacterCreation(ref p1); startScreen = new StartScreen(); deathScreen = new DeathScreen(); startScreen.NewGame.Click += NewGame_Click; startScreen.LoadGame.Click += loadGame_Click; deathScreen.StartScreen.Click += StartGame_Click; deathScreen.EndGame.Click += EndGame_Click; charCreation.strUp.Click += plusStr_Click; charCreation.dexUp.Click += plusDex_Click; charCreation.intUp.Click += plusInt_Click; charCreation.strdwn.Click += strdwn_Click; charCreation.dexdwn.Click += dexdwn_Click; charCreation.intdwn.Click += intdwn_Click; charCreation.completeButton.Click += completeButton_Click; inGameScreen.muteButton.Click += muteSound_Click; inGameScreen.armorBox.SelectionChanged += armorBox_SelectionChanged; inGameScreen.weaponBox.SelectionChanged += weaponBox_SelectionChanged; inGameScreen.useConsumable.Click += useConsumable_Click; inGameScreen.plusDex.Click += plusDex_Click; inGameScreen.plusInt.Click += plusInt_Click; inGameScreen.plusStr.Click += plusStr_Click; inGameScreen.Shop1.sellWeapon.Click += sellWeapon_Click; inGameScreen.Shop1.sellArmor.Click += sellArmor_Click; inGameScreen.Shop1.sellConsumable.Click += sellConsumable_Click; inGameScreen.Shop1.buyWeapon.Click += buyWeapon_Click; inGameScreen.Shop1.buyArmor.Click += buyArmor_Click; inGameScreen.Shop1.buyConsumable.Click += buyConsumable_Click; inGameScreen.Shop1.weaponBox.ItemsSource = p1.weaponInventory; inGameScreen.Shop1.armorBox.ItemsSource = p1.armorInventory; inGameScreen.Shop1.consumeBox.ItemsSource = p1.itemInventory; inGameScreen.Shop1.weaponBox.SelectionChanged += storeWeaponBox_SelectionChanged; inGameScreen.Shop1.armorBox.SelectionChanged += storeArmorBox_SelectionChanged; inGameScreen.Shop1.consumeBox.SelectionChanged += storeConsumeBox_SelectionChanged; inGameScreen.Shop1.shopWeaponBox.SelectionChanged += shopWeaponBox_SelectionChanged; inGameScreen.Shop1.shopArmorBox.SelectionChanged += shopArmorBox_SelectionChanged; inGameScreen.Shop1.shopConsumeBox.SelectionChanged += shopConsumeBox_SelectionChanged; inGameScreen.Shop1.shopWeaponBox.ItemsSource = shopWeaponInventory; inGameScreen.Shop1.shopArmorBox.ItemsSource = shopArmorInventory; inGameScreen.Shop1.shopConsumeBox.ItemsSource = shopConsumableInventory; inGameScreen.Shop1.playerGold.DataContext = p1; inGameScreen.Shop1.Visibility = Visibility.Hidden; }
public void TestIfStartScreenSetChoiseIsExecutedWithD3Key() { StartScreen startscreen = StartScreen.Instance; startscreen.SetChoise(ConsoleKey.D3); Assert.AreEqual(true, true, "StartScreen.SetChoise() didn't execute with D3 key passed"); }
public TheController() { memberController = new MemberController(new MembersForm(), new MembersAddForm(), new MemberService()); bookController = new BookController(new BookForm(), new BookAddForm(), new BookService(), new SearchBookForm(), new SearchBookResultForm()); startScreen = new StartScreen(); startScreen.SetControllers(memberController, bookController); startScreen.ShowDialog(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); InitialScreen = new StartScreen(); InitialScreen.Show(); Application.Run(); }
private new void Awake() { base.Awake(); gameOverScreen = FindObjectOfType <GameOverScreen>(); StartScreen = FindObjectOfType <StartScreen>(); bearAnimator = bearImageGameObject.GetComponent <Animator>(); }
public GameManager() { //GameScreen //currentScreen = new MainGameScreen(); //StartScreen startScreen = new StartScreen(); currentScreen = startScreen; }
public Screen(int width, int height) { MainConsole = new MainConsole(width - MENU_WIDTH - 1, height - MESSAGES_HEIGHT); MessageConsole = new MessageConsole(1, height - MESSAGES_HEIGHT + 1, width, MESSAGES_HEIGHT); MenuConsole = new MenuConsole(width - MENU_WIDTH, 1, MENU_WIDTH + 1, height - MESSAGES_HEIGHT + 1); StartScreen = new StartScreen(width + 2, height + 2); }
public void TestIfRenderStartUpScreenWorks() { StartScreen startscreen = StartScreen.Instance; PrivateObject obj = new PrivateObject(startscreen); var retVal = obj.Invoke("RenderStartUpScreen"); Assert.AreEqual(retVal, retVal); }
/// <summary> /// Controls the game activities sequence, from intro to ending, /// including gameplay and settings activity. /// </summary> protected override async Task Play() { var startScreen = new StartScreen(this); var setupScreen = new GamePlaySetup(this); while (true) { try { switch (await startScreen.Run()) { case StartScreen.Options.Exit: return; case StartScreen.Options.HowToPlay: await new HowToPlay(this).Run(); continue; case StartScreen.Options.Play: break; default: throw new NotImplementedException(); } bool playAgain; do { var setup = await setupScreen.Run(); if (setup.Aborted) { break; } var gamePlay = new GamePlay(this, setup); var gameResult = await gamePlay.Run(); playAgain = gameResult.Aborted; if (!gameResult.Aborted) { await new ShowResults(this, gameResult).Run(); } } while(playAgain); } catch (Exception ex) { Console.WriteLine(ex); #if DEBUG if (Debugger.IsAttached) { Debugger.Break(); } #endif } } }
public void TestIfNumpad1KeyIsHandledByStartScreenHandleD1Key() { ConsoleKey key = ConsoleKey.NumPad1; StartScreen startscreen = StartScreen.Instance; PrivateObject obj = new PrivateObject(startscreen); var retVal = obj.Invoke("HandleD1Key", key); Assert.AreEqual(retVal, true, "Expected result true when StartScreen.HandleD1Key is called with NumPad1. Returned false"); }
public RpgGame(GameWindow window, ContentManager contentManager) : base(window, contentManager) { FontGraphics.LoadContent(contentManager); RpgGraphics.LoadContent(contentManager); var startScreen = new StartScreen(); NextLevel(startScreen); }
void Start() { if (instance == null) { instance = this; DontDestroyOnLoad(this); Instantiate(StartScreenPrefab); } }
public void TestIfStartScreenHandleD3KeyRerunsFalseWhenSomeOtherKeyThanD3OrNumPad3IsChosen() { ConsoleKey key = ConsoleKey.NumPad1; StartScreen startscreen = StartScreen.Instance; PrivateObject obj = new PrivateObject(startscreen); var retVal = obj.Invoke("HandleD3Key", key); Assert.AreEqual(retVal, false, "Expected result false when StartScreen.HandleD3Key is called with different key than D3 or NumPad3. Returned true"); }
// Use this for initialization void Start() { Instantiate(Resources.Load("Characters/" + ZPlayerPrefs.GetString("Player")), transform.position, Quaternion.identity); // Don't let screen turn off Screen.sleepTimeout = SleepTimeout.NeverSleep; ss = this.GetComponent("StartScreen") as StartScreen; cs = GameObject.FindObjectOfType <CatScript>(); }
void Start() { startBack = GameObject.Find("EventSystem").GetComponent <StartScreen>(); //startBack.disableSplash(); if (SceneManager.GetActiveScene().name != "StartMenu") { playerTools = GameObject.Find("Player").GetComponent <Weapons>(); } }
// Use this for initialization void Awake() { if(current == null) { current = this; } titleStyle.fontSize = 20; titleStyle.alignment = TextAnchor.MiddleCenter; titleStyle.normal.textColor = Color.white; }
private void InitStartScreen() { startScreen = new StartScreen(); this.startScreen.btn_GameStart.Click += Click_StartNewGame; this.startScreen.btn_CreateOwnGame.Click += Btn_CreateOwnGame_Click; config.FieldSize = Enums.MatchingGameEnums.FieldSize.TwentyEight; config.WithBonusGame = true; config.WithAdminPanel = true; }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); startScreen = new StartScreen(this, spriteBatch); Components.Add(startScreen); actionScreen = new ActionScreen(this, spriteBatch); Components.Add(actionScreen); }
internal static int LaunchStartScreen(out string initialFileName) { EditorBootstrapper.EnableVisualStyles(); using (var startScreen = new StartScreen()) { Application.Run(startScreen); initialFileName = startScreen.FileName; return((int)startScreen.EditorResult); } }
void Awake() { if( mInstance != null ) { Debug.LogError( string.Format( "Only one instance of StartScreen allowed! Destroying:" + gameObject.name +", Other:" + mInstance.gameObject.name ) ); return; } mInstance = this; HighlightPlay(); }
protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); Services.AddService(typeof(SpriteBatch), spriteBatch); normalFont = Content.Load<SpriteFont>("normal"); background = Content.Load<Texture2D>("gryphon"); startScreen = new StartScreen(this, normalFont, background); Components.Add(startScreen); background = Content.Load<Texture2D>("fire-dragon"); helpScreen = new HelpScreen(this, background); Components.Add(helpScreen); startScreen.Show(); helpScreen.Hide(); activeScreen = startScreen; }
//function which executes on scene awake before the start function void Awake() { //find the ImageLS gameobject from the Hierarchy loadingScreenImage = GameObject.Find("SplashImage"); //destroy the already existing instance, if any if (instance) { Destroy(gameObject); hide(); //call hide function to hide the 'loading Screen Sprite' return; } instance = this; //instance.loadingScreenImage.SetActive(false); // DontDestroyOnLoad(this); //make this object persistent between scenes }
protected override void LoadContent() { this.IsMouseVisible = true; this.graphics.PreferredBackBufferWidth = GlobalVariables.WindowWidthDefault; // set this value to the desired width of your window this.graphics.PreferredBackBufferHeight = GlobalVariables.WindowHeightDefault; // set this value to the desired height of your window this.graphics.ApplyChanges(); this.statPanel = new StatPanel(); this.startScreen = new StartScreen(); this.deathScreen = new DeathScreen(); this.stage = GameStages.Start_Stage; // Create a new SpriteBatch, which can be used to draw textures. this.spriteBatch = new SpriteBatch(this.GraphicsDevice); GfxHandler.Load(this.Content); this.startScreen.Load(this.Content); this.deathScreen.Load(this.Content); this.statPanel.Load(this.Content); }
protected void InitialiseGameScreens() { _pauseScreen = new PauseScreen(this); _gameOverScreen = new GameOverScreen(this); _startScreen = new StartScreen(this); WaitCallback loadGameCallback = new WaitCallback(LoadMainGameScreen); ThreadPool.QueueUserWorkItem(loadGameCallback); _activeScreen = _startScreen; _inactiveScreens.Add(_pauseScreen); _inactiveScreens.Add(_gameOverScreen); }
int countSet = 0; // # of players who have chosen a team #endregion Fields #region Methods void Awake() { S = this; }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // Load the content for the start screen, add it to the components, and hide it. startScreen = new StartScreen(this, spriteBatch, Content.Load<SpriteFont>("menufont"), Content.Load<Texture2D>("Menus/StartScreen")); Components.Add(startScreen); startScreen.Hide(); // Load the content for the loading screen. splashScreen = new SplashScreen(this, spriteBatch, Content.Load<Texture2D>("Menus/SampleSplashScreen")); Components.Add(splashScreen); splashScreen.Hide(); // Load the content for the action screen, where most of the gameplay will occur. actionScreen = new ActionScreen(this, spriteBatch); Components.Add(actionScreen); actionScreen.Hide(); // Load the content for the pause screen. pauseScreen = new PauseScreen(this, spriteBatch, Content.Load<SpriteFont>("menufont"), Content.Load<Texture2D>("Menus/PauseScreen"), actionScreen); Components.Add(pauseScreen); pauseScreen.Hide(); // Load the content for the quit screen. quitScreen = new QuitScreen(this, spriteBatch, Content.Load<SpriteFont>("menufont"), Content.Load<Texture2D>("Menus/QuitScreen"), actionScreen); Components.Add(quitScreen); quitScreen.Hide(); // Load the content for the dialogue screen. dialogueScreen = new DialogueScreen(this, spriteBatch, Content.Load<SpriteFont>("menufont"), Content.Load<Texture2D>("Menus/DialogueScreen"), actionScreen); Components.Add(dialogueScreen); dialogueScreen.Hide(); // When the game starts, the active screen is the start screen. activeScreen = startScreen; activeScreen.Show(); }