Inheritance: MonoBehaviour
        private void btnMainMenu_Click(object sender, EventArgs e)
        {
            this.Hide();
            mainMenu mMenu = new mainMenu();

            mMenu.Show();
        }
Esempio n. 2
0
        private static void Fobj_onClick(FObject fObject, int x, int y)
        {
            mainMenu m = new mainMenu();

            handle.FObjects.Clear();
            handle.FObjects = m.LoadScene().ToList();
        }
Esempio n. 3
0
 void Start()
 {
     mainMenuScript  = GameObject.Find("homeButton").GetComponent <mainMenu>();
     audioMuteScript = GameObject.Find("audioMuteButton").GetComponent <audioMute>();
     exitGameScript  = GameObject.Find("exitButton").GetComponent <exitGame>();
     pauseBarScript  = GameObject.Find("bar").GetComponent <pauseBarHorizontal>();
 }
Esempio n. 4
0
        /// <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);

            // TODO: use this.Content to load your game content here
            gameContent  = new GameContent(Content);
            screenWidth  = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
            screenHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
            if (screenWidth >= 1920)
            {
                screenWidth = 1920;
            }
            if (screenHeight >= 1080)
            {
                screenHeight = 1080;
            }
            graphics.PreferredBackBufferWidth  = screenWidth;
            graphics.PreferredBackBufferHeight = screenHeight;
            //graphics.IsFullScreen = true;
            graphics.ApplyChanges();

            if (activeState == GameStates.Menu)
            {
                mainmenu = new mainMenu(spriteBatch, gameContent);
                options.Add(new menuOption(spriteBatch, gameContent, true, 400, 400, 1));
                options.Add(new menuOption(spriteBatch, gameContent, false, 1110, 400, 2));
            }
            if (activeState == GameStates.Playing)
            {
                //Fences
                fences.Add(new Fence(125, 50, false, gameContent));
                fences.Add(new Fence(350, 50, false, gameContent));
                fences.Add(new Fence(575, 50, false, gameContent));
                fences.Add(new Fence(688, 163, true, gameContent));
                fences.Add(new Fence(688, 390, true, gameContent));
                fences.Add(new Fence(688, 390, true, gameContent));
                fences.Add(new Fence(688, 617, true, gameContent));

                fences.Add(new Fence(125, 300, false, gameContent));
                fences.Add(new Fence(343, 300, false, gameContent));
                fences.Add(new Fence(457, 413, true, gameContent));
                fences.Add(new Fence(457, 620, true, gameContent));
                player = new Player(200, 200, spriteBatch, gameContent, 3, 1, 500);
                images.Add(new Images(gameContent, 0, 0, 1));
                //images.Add(new Images(gameContent,2,315,2));
                images.Add(new Images(gameContent, 710, 925, 3));
                images.Add(new Images(gameContent, 510, 190, 4));
                shops.Add(new Shop(95, 315, gameContent));
                shops.Add(new Shop(900, 400, gameContent));

                //Text
                cashText = Content.Load <SpriteFont>("playerCash");
            }
            if (activeState == GameStates.Paused)
            {
                //Stuff
            }
        }
Esempio n. 5
0
    void Start()
    {
        mainMenuScript       = GameObject.Find("mainMenuButton").GetComponent <mainMenu>();
        levelSelectionScript = GameObject.Find("levelSelectionButton").GetComponent <levelSelection>();
        refreshGameScript    = GameObject.Find("refreshButton").GetComponent <refreshGame>();
        exitGameScript       = GameObject.Find("exitButton").GetComponent <exitGame>();
        pauseBarScript       = GameObject.Find("pauseBarHorizontal").GetComponent <pauseBarHorizontal>();

        timerBG      = GameObject.Find("timerBG");
        timerGUIText = GameObject.Find("timerGUIText");
    }
        private void btnLogIn_Click(object sender, RoutedEventArgs e)
        {
            bool authorisation = _data.AuthoriseUser(txtUsername.Text, txtPassword.Text);

            if (authorisation)
            {
                mainMenu main = new mainMenu(_data);
                main.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Authorisation Failed.", "Connect Transport", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
        }