Inheritance: System.Web.UI.Page
Ejemplo n.º 1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (var game = new Game2())
     {
         game.Run();
     }
 }
 private static void Sc() // start clocks
 {
     if (Game2.IsFirstKeyPressInGame)
     {
         Game2.StartClocks();
     }
 }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            BaseGamerAndGameManager gamerAndGameManager = new Game1();
            Gamer gamer = new Gamer {
                DateOfBirth = new DateTime(2001, 10, 27), FirstName = "Begüm", LastName = "Muşdal", NationalityId = "11111111111"
            };
            Gamer gamer2 = new Gamer {
                DateOfBirth = new DateTime(2001, 10, 25), FirstName = "Nisa", LastName = "Has", NationalityId = "22222222222"
            };

            gamerAndGameManager.Save(gamer);
            gamerAndGameManager.Buy(gamer);
            gamerAndGameManager.CampaignOfGameSave(gamer);
            gamerAndGameManager.Delete(gamer);
            gamerAndGameManager.Save(gamer2);
            gamerAndGameManager.Buy(gamer2);
            gamerAndGameManager.CampaignOfGameUpdate(gamer2);
            gamerAndGameManager.Delete(gamer2);

            BaseGamerAndGameManager gamerAndGameManager2 = new Game2();
            Gamer gamer3 = new Gamer {
                DateOfBirth = new DateTime(2001, 10, 8), FirstName = "Begüm", LastName = "Ünal", NationalityId = "33333333333"
            };

            gamerAndGameManager2.Save(gamer3);
            gamerAndGameManager2.Buy(gamer3);

            Console.ReadLine();
        }
Ejemplo n.º 4
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game2 game = new Game2())
     {
         game.Run();
     }
 }
Ejemplo n.º 5
0
    // GRID LOGIC HERE

    // Use this for initialization
    public void Start()
    {
        game = GameObject.Find("Main Game").GetComponent <Game2>();
        box  = transform.GetComponent <BoxCollider2D>();

/*		yfloor = transform.position.y-transform.localScale.y*box.size.y/2;
 *              yceiling = transform.position.y+transform.localScale.y*box.size.y/2;
 *              xleft = transform.position.x-transform.localScale.x*box.size.x/2;
 *              xright = transform.position.x+transform.localScale.x*box.size.x/2;
 *              spawnPosition = transform.FindChild("SpawnPosition").position;*/

        //	Debug.Log ("Ceiling: " + yceiling);
        //	Debug.Log ("floor: " + yfloor);
        //	Debug.Log ("left: " + xleft);
        //	Debug.Log ("right: " + xright);

        //grid = this.GetComponent<Grid2D>();
        //gridOffset = new Vector3(xLeft,yFloor,0);
        //grid.offset = gridOffset;

        //grid = GetComponent<Grid2D>();

        //grid.Width = 5;
        //grid.Height = 1;
        //grid.CellWidth = (Mathf.Abs (xright-xleft)/grid.Width)/transform.localScale.x;
//		Debug.Log ("CellWidth: " + grid.CellWidth);
        //grid.CellHeight = Mathf.Abs (yceiling-yfloor)/grid.Height;
//		Debug.Log ("CellHeight: " + grid.CellHeight);
        nodes = transform.GetComponentsInChildren <Node>();
        //nodes = transform.

        /*
         * for (int y = 0; y < grid.Height; ++y)
         * {
         *      for (int x = 0; x < grid.Width; ++x)
         *      {
         *              // Instantiate new object
         *              GameObject instance = Instantiate(PrefabToPlace) as GameObject;
         *
         *              // Move to correct position
         *              instance.transform.position = grid.GetBottomCenter(x, y);
         *
         *              // Add the object to the grid
         *              grid.Add(instance.transform, x, y);
         *      }
         * }
         */

        people       = new GameObject[3, 2];
        people[0, 0] = Resources.Load <GameObject>("Prefabs/Person/Boy");
        people[0, 1] = Resources.Load <GameObject>("Prefabs/Person/Girl");
        people[1, 0] = Resources.Load <GameObject>("Prefabs/Person/Man");
        people[1, 1] = Resources.Load <GameObject>("Prefabs/Person/Lady");
        people[2, 0] = Resources.Load <GameObject>("Prefabs/Person/RichMan");
        people[2, 1] = Resources.Load <GameObject>("Prefabs/Person/RichLady");
        //personThug = Resources.Load<GameObject>("Prefabs/Person/Thug");
        //personPriest = Resources.Load<GameObject>("Prefabs/Person/Priest");
        HASLOADED = true;
    }
 private void Hamsterinflation()
 {
     if (i == interval)
     {                                                                       // every i moves
         Console.WriteLine("Enemy {0} called Hamsterinflation().", e.Index); // debug
         Game2.Hamsterinflation();
         i = 0;
     }
     i++;
 }
    public void isrowfull2test()
    {
        var   go      = new GameObject();
        Game2 rowtest = go.AddComponent <Game2>();

        rowtest.isrowfull2(7);
        LogAssert.Expect(LogType.Log, "Log message");
        Debug.Log("Log message");
        Debug.LogError("Error message");
        LogAssert.Expect(LogType.Error, "Error message");
    }
Ejemplo n.º 8
0
    public void generateblock2test()
    {
        var   go        = new GameObject();
        Game2 blocktest = go.AddComponent <Game2>();

        blocktest.generatenextblock2();
        LogAssert.Expect(LogType.Log, "Log message");
        Debug.Log("Log message");
        Debug.LogError("Error message");
        LogAssert.Expect(LogType.Error, "Error message");
    }
Ejemplo n.º 9
0
    public void gamescore2test()
    {
        var   go        = new GameObject();
        Game2 blocktest = go.AddComponent <Game2>();

        blocktest.gamescore_function2();
        LogAssert.Expect(LogType.Log, "Log message");
        Debug.Log("Log message");
        Debug.LogError("Error message");
        LogAssert.Expect(LogType.Error, "Error message");
    }
Ejemplo n.º 10
0
        public static long GetHighScore2(int playersCount, int lastMarbleWorth)
        {
            var game   = new Game2();
            var scores = new long[playersCount];

            for (var m = 1; m <= lastMarbleWorth; m++)
            {
                scores[m % playersCount] += game.AddMarble(m);
                //Console.WriteLine($"{m,3}: {game.Describe()}");
            }
            return(scores.Max());
        }
Ejemplo n.º 11
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
     initialCameraPosition = transform.position;
 }
Ejemplo n.º 12
0
    public override string SolvePart2()
    {
        IGame game = new Game2(_deck1.GetCopy(), _deck2.GetCopy());

        game.Play();
        if (game.Winner is null)
        {
            throw new InvalidOperationException("No winner after the game.");
        }
        int score = game.Winner.Score;

        return(score.ToString());
    }
Ejemplo n.º 13
0
        private void ClearGame()
        {
            game = new Game2();

            B1.Content = " ";
            B2.Content = " ";
            B3.Content = " ";
            B4.Content = " ";
            B5.Content = " ";
            B6.Content = " ";
            B7.Content = " ";
            B8.Content = " ";
            B9.Content = " ";
        }
Ejemplo n.º 14
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);


            Window.Current.CoreWindow.KeyUp += Menu_KeyUp;
            ToggleCurser();

            var gameInfo = (GameInfo)e.Parameter;

            var gameName = gameInfo.gameName;

            var inputs = new MouseKeyboardInputs(lockCurser, playerId);

            game = new Game2();

            zoomer = new MouseZoomer(GameHolder.ActualWidth, GameHolder.ActualHeight, fieldDimensions, (GameState gs) =>
            {
                return(gs.players.Where(x => x.Key == playerId).Select(x => x.Value.PlayerBody.Position)
                       .Union(new[] { gs.GameBall.Posistion })
                       .ToArray());
            });
            //zoomer = new FullField(GameHolder.ActualWidth, GameHolder.ActualHeight, fieldDimensions.xMax / 2.0, fieldDimensions.yMax / 2.0);
            renderGameState = new RenderGameState2(/*Canvas,*/ zoomer, LeftScore, RightScore);

            var signalRHandler = SingleSignalRHandler.GetOrThrow();
            var color          = GetColor();

            signalRHandler.Send(gameName, new AddPlayerEvent(
                                    playerId,
                                    "",
                                    BodyA,
                                    color[0],
                                    color[1],
                                    color[2],
                                    0xff,
                                    color[0],
                                    color[1],
                                    color[2],
                                    new Physics2.Vector(fieldDimensions.xMax / 2.0, fieldDimensions.yMax / 2.0)
                                    ));

            inputs.Init().ContinueWith(_ =>
            {
                signalRHandler.Send(gameName, Inputs(inputs));
            });

            var dontWait = MainLoop(signalRHandler.JoinChannel(new JoinChannel(gameName)));
        }
Ejemplo n.º 15
0
//	public GUISkin skin = new GUISkin();
//	public int LEFT_EDGE;
    //public TutorialSlideshow tutorial;

    // Use this for initialization
    private void Start()
    {
//		mytype = Resources.Load<Font>("Fonts/my_type_of_font/mytype");

//		nightProgressTexture = Resources.Load<Texture2D>("Sprites/gui/nightskyTexture");
        if (game == null)
        {
            game = GameObject.Find("Main Game").GetComponent <Game2>();
        }
        //if (tutorial==null){
        //	tutorial = GameObject.Find ("Main Game").GetComponent<TutorialSlideshow>();
        //}

//		LEFT_EDGE = 2*width;
    }
 void ReleaseDesignerOutlets()
 {
     if (Game1 != null)
     {
         Game1.Dispose();
         Game1 = null;
     }
     if (Game2 != null)
     {
         Game2.Dispose();
         Game2 = null;
     }
     if (Game3 != null)
     {
         Game3.Dispose();
         Game3 = null;
     }
 }
Ejemplo n.º 17
0
 public void Setup(Game2 data)
 {
     answerData      = data;
     answerText.text = answerData.answerText;
 }
Ejemplo n.º 18
0
 // Use this for initialization
 void Start()
 {
     game = GameObject.Find("Main Game").GetComponent <Game2>();
     sp   = GetComponent <SpriteRenderer>();
 }
Ejemplo n.º 19
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            Window.Current.CoreWindow.KeyUp += Menu_KeyUp;

            //zoomer = new ShowAllPositions(GameHolder.ActualWidth, GameHolder.ActualHeight, fieldDimensions);


            //rge = new RenderGameEvents(GameArea, Fps, LeftScore, RightScore, zoomer, frame, fieldDimensions);

            //if (lockCurser.Thing)
            //{
            //    Window.Current.CoreWindow.PointerPosition = new Windows.Foundation.Point(
            //        (Window.Current.CoreWindow.Bounds.Left + Window.Current.CoreWindow.Bounds.Right) / 2.0,
            //        (Window.Current.CoreWindow.Bounds.Top + Window.Current.CoreWindow.Bounds.Bottom) / 2.0);
            //    Window.Current.CoreWindow.PointerCursor = null;
            //}
            //else
            //{
            //    Window.Current.CoreWindow.PointerCursor = new CoreCursor(CoreCursorType.Arrow, 0);
            //}

            var gameInfo = (GameInfo)e.Parameter;

            var gameName = gameInfo.gameName;

            game = new Game2();


            var teamSize = 5;

            var ourTeam = new Guid[teamSize].Select(x => Guid.NewGuid()).ToArray();

            //zoomer = new MouseZoomer(GameHolder.ActualWidth, GameHolder.ActualHeight, fieldDimensions, (GameState gs)=> {


            //    return gs.players.Where(x =>  x.Key == ourTeam[0]).Select(x => x.Value.PlayerBody.Position)
            //    .Union(new[] { gs.GameBall.Posistion })
            //    .ToArray();

            //});


            // this blocks like a mofo
            // we don't want anything to get a peice of the main thread while we are setting up
            try
            {
                //if (gameInfo.controlScheme == ControlScheme.MouseAndKeyboard)
                //{
                //    var body = ourTeam.First();
                //    var inputs = new MouseKeyboardInputs(lockCurser, body);
                //    await inputs.Init();
                //    await CreatePlayer(body, inputs, new byte[3] { 0x88, 0x00, 0xff });
                //}

                //foreach (var body in ourTeam)//.Skip(1)
                //{
                //    var inputs = new AIInputs(game.gameState, body, ourTeam.Except(new Guid[] { body }).ToArray(), fieldDimensions, false);
                //    await inputs.Init();
                //    await CreatePlayer(body, inputs, new byte[3] { 0x00, 0x00, 0xff });
                //}


                //https://stackoverflow.com/questions/48997243/uwp-gamepad-gamepads-is-empty-even-though-a-controller-is-connected
                //var x = 0;
                //while (x < 10)
                //{
                //    var db = Gamepad.Gamepads.Count;
                //    Task.Delay(100).Wait();
                //    x++;
                //}


                //var gps = Gamepad.Gamepads.ToArray();
                //foreach (var (gamePad, key) in gps.Zip(ourTeam.Take(gps.Length), (x, y) => (x, y)))
                //{
                //    var body = key;// Guid.NewGuid();
                //    var inputs = CreateController(gamePad, body);
                //    inputs.Init().Wait();
                //    CreatePlayer(body, inputs).Wait();
                //}

                var body   = ourTeam.First();
                var inputs = new MouseKeyboardInputs(lockCurser, body);
                await inputs.Init();
                await CreatePlayer(body, inputs, new byte[3] {
                    0x88, 0x00, 0xff
                });

                {
                    var team = new AITeam(game.gameState, ourTeam, fieldDimensions, false);

                    foreach (var(key, input) in team.GetPlayers().Skip(1 /*gps.Length*/))
                    {
                        input.Init().Wait();
                        CreatePlayer(key, input, new byte[3] {
                            0x00, 0x00, 0xff
                        }).Wait();
                    }
                }

                var theirTeam = new Guid[teamSize].Select(x => Guid.NewGuid()).ToArray();

                {
                    var team = new AITeam(game.gameState, theirTeam, fieldDimensions, true);

                    foreach (var(key, input) in team.GetPlayers())
                    {
                        input.Init().Wait();
                        CreatePlayer(key, input, new byte[3] {
                            0xff, 0x00, 0x00
                        }).Wait();
                    }
                }
            }
            catch (Exception ex)
            {
                await OnDisconnect(ex);
            }

            var ourBody = localPlayers.Read().First().LocalId;

            zoomerLeft  = new Zoomer(CanvasLeft.ActualWidth, CanvasLeft.ActualHeight, ourBody, .0025);
            zoomerRight = new Zoomer(CanvasRight.ActualWidth, CanvasRight.ActualHeight, ourBody, .01);
            //renderGameState = new RenderGameState(GameArea, zoomer, LeftScore, RightScore);
            renderGameStateLeft  = new RenderGameState2(/*Canvas,*/ zoomerLeft, LeftScore, RightScore);
            renderGameStateRight = new RenderGameState2(/*Canvas,*/ zoomerRight, LeftScore, RightScore);

            Task.Run(async() =>
            {
                try {
                    MainLoop();
                }
                catch (Exception ex)
                {
                    await OnDisconnect(ex);
                }
            });
        }
Ejemplo n.º 20
0
//	private Font mytype;

    void Start()
    {
//		mytype = Resources.Load<Font>("Fonts/my_type_of_font/mytype");
        ability1 = transform.GetComponent <Ability_Ghost>();
        ability2 = transform.GetComponent <Ability_Repair>();
        ability3 = transform.GetComponent <Ability_Claw>();
        ability4 = transform.GetComponent <Ability_Monster>();
        ability5 = transform.GetComponent <Ability_Possess>();
        game     = transform.GetComponent <Game2>();
        DaySlides.Add(
            "HOW TO PLAY (DAYTIME)\n" +
            "You are the owner of a haunted " +
            "hotel. Your goal is to generate money and fear, by luring in the wealthiest " +
            "visitors, and then giving them a scare!\n" +
            "During the daytime when nobody is around, you will set up furniture and traps " +
            "in the hotel rooms. You can also purchase new floors to use for your hotel. " +
            "\n\nCan you build the biggest, baddest, hauntel hotel???"
            );
        DaySlides.Add(
            "You can navigate up and down floors by clicking on the up/down triangles on the right " +
            "side of the screen. To buy a new floor, go to your top floor and click on the button that " +
            "appears at the top of the screen. If you have enough money, your hotel grows by another floor."
            );
        DaySlides.Add(
            "Each floor has 5 spaces where you can place furniture. To place furniture, select " +
            "a type of furniture from the buttons at the bottom of the screen. You can also sell furniture by " +
            "clicking on it, although you get less money back if it is damaged.\n" +
            "Furniture makes a room more valuable. More expensive pieces of furniture equal more value for " +
            "that room. The bed and chairs are normal furniture."
            );
        DaySlides.Add(
            "Lamps are a special type of furniture that generate light and can be turned on or off. When " +
            "a person touches a lamp that is turned off, they will turn it on. The normal and fancy lamps " +
            "heal people's sanity when they turn it on. The scary lamp, on the other hand, scares them when " +
            "they turn it on. You can also manually toggle lamps by clicking on them."
            );
        DaySlides.Add(
            "The Armoire and Portrait are traps that you can click on at night to activate. When people are " +
            "in front of a trap, click on it to activate its scare effect. Any person " +
            "standing nearby will get scared. Once you activate a trap, you cannot use it again until the next " +
            "night or until you repair it."
            );
        DaySlides.Add(
            "Remember, the nicer the floors are, the more likely it is to bring in " +
            "wealthy visitors, who will drop more money overnight.\n\n" +
            "Once you have placed some furniture in the hotel, press \"START\" to bring in visitors."
            );
        NightSlides.Add(
            "HOW TO PLAY (NIGHT)\n" +
            "When night starts, people check in and give you initial money. " +
            "They will also drop money at intervals during the night, based on how wealthy they are " +
            "and how nice the room is. Your furniture will also sustain damage when people use it.\n" +
            "Night time ends once you have scared everyone out of the hotel, or once the " +
            "clock reaches 6:00 am (This is aroud " + game.GAME_MINUTES + " minutes realtime), " +
            "but you can also quit manually by clicking the \"Finish\" button."
            );
        NightSlides.Add(
            "At night, generate as much fear and money as possible. People will drop money throughout the " +
            "night based on how nice their room is. At the end of the " +
            "night, all of the fear you have collected will give you a huge money bonus."
            );
        NightSlides.Add(
            "Warning: Your fear is constantly decreasing, so you need to keep it up!\n\n" +
            "Be careful, though. If you scare too many people out of the hotel, then there " +
            "won't be enough people around to drop money. The point is that you need to be smart " +
            "about when to scare people and when to wait."
            );
        NightSlides.Add(
            "Different types of people will check into the hotel based on how nice the rooms are. " +
            "Each family has at least 1 adult. There are also boys and girls, who are easier to " +
            "scare but don't drop as much money. If the room is very nice, and the total value of " +
            "the furniture is over $1000, you may start to see rich men and women check in as well. " +
            "They don't drop as much fear, but they drop a lot of money and very frequently."
            );
        NightSlides.Add(
            "The thug will actively try to destroy your furniture with his club, and the " +
            "priest will try to destroy your scary traps. It is a wise idea to scare them " +
            "out of the room as quickly as possible, although they will check back in " +
            "after some time."
            );
        NightSlides.Add(
            "In addition to clicking on traps you have placed, you can also spend some of " +
            "your fear to use special abilities. There are 5 abilities you can use: Ghost, " +
            "Repair, Claw, Monster, and Possession. Each does some damage to people who " +
            "touch it. An ability requires a minimum amount of fear and " +
            "energy cost to use, and has a cooldown on use. By using the ability, you pay its " +
            "energy cost from your current fear level."
            );
        NightSlides.Add(
            "GHOST ability: Summon a ghost where you click.\n" +
            "Minimum fear level: " + ability1.MinFear + "%\n" +
            "Cooldown time: " + ability1.TimeCooldown + " seconds\n" +
            "Damage: " + ability1.Damage + "\n" +
            "Duration: " + ability1.TimeDuration + " seconds\n" +
            "Cost per use: free"
            );
        NightSlides.Add(
            "REPAIR ability: Fix damaged furniture and restore their durability by up to 30%. Click on a piece of " +
            "furniture to use this ability. It can also reset your traps.\n" +
            "Minimum fear level: " + ability2.MinFear + "%\n" +
            "Cooldown time: " + ability2.TimeCooldown + " seconds\n" +
            "Damage: " + ability2.Damage + "\n" +
            "Duration: " + ability2.TimeDuration + " seconds\n" +
            "Cost per use: -" + ability2.UseCost + "% fear"
            );
        NightSlides.Add(
            "CLAW ability: Finds the nearest person and drags them back to the claw's origin.\n" +
            "Minimum fear level: " + ability3.MinFear + "%\n" +
            "Cooldown time: " + ability3.TimeCooldown + " seconds\n" +
            "Damage: " + ability3.Damage + "\n" +
            "Duration: " + ability3.TimeDuration + " seconds\n" +
            "Cost per use: -" + ability3.UseCost + "% fear"
            );
        NightSlides.Add(
            "MONSTER ability: Moves around the room and terrifies anyone in its way.\n" +
            "Minimum fear level: " + ability4.MinFear + "%\n" +
            "Cooldown time: " + ability4.TimeCooldown + " seconds\n" +
            "Damage: " + ability4.Damage + "\n" +
            "Duration: " + ability4.TimeDuration + " seconds\n" +
            "Cost per use: -" + ability4.UseCost + "% fear"
            );
        NightSlides.Add(
            "POSSESSION ability: Take over a person's soul and fly them around like a puppet.\n" +
            "Minimum fear level: " + ability5.MinFear + "%\n" +
            "Cooldown time: " + ability5.TimeCooldown + " seconds\n" +
            "Damage: " + ability5.Damage + "\n" +
            "Duration: " + ability5.TimeDuration + " seconds\n" +
            "Cost per use: -" + ability5.UseCost + "% fear"
            );
    }
Ejemplo n.º 21
0
 protected virtual void Start()
 {
     game          = transform.GetComponent <Game2>();
     cooldownTimer = 0f;
 }
        private static void HandleMousePressed()
        {
            int       x  = Mouse.GetState().X; // x coord of mouse position where clicked
            int       y  = Mouse.GetState().Y; // y coord of mouse position where clicked
            GameState gs = GameMain.Gamestate;

            switch (gs)
            {
            case GameState.Startmenu:

                // Cross button
                if (CollisionBtn(GameMain.BtnsStartmenu[0], x, y))
                {
                    GameMain.self.Exit();
                }

                // Hamster skins button
                if (CollisionBtn(GameMain.BtnsStartmenu[1], x, y))
                {
                    switch (GameMain.HamsterSkin)
                    {
                    case HamsterSkin.Default:
                        GameMain.HamsterSkin = HamsterSkin.Candy;         // select next skin
                        break;

                    case HamsterSkin.Candy:
                        GameMain.HamsterSkin = HamsterSkin.Pokemon;
                        break;

                    case HamsterSkin.Pokemon:
                        GameMain.HamsterSkin = HamsterSkin.Default;
                        break;

                    default:
                        break;
                    }
                }

                // Python skins button
                if (CollisionBtn(GameMain.BtnsStartmenu[2], x, y))
                {
                    switch (GameMain.PythonSkin)
                    {
                    case PythonSkin.Default:
                        GameMain.PythonSkin = PythonSkin.Bloody;
                        break;

                    case PythonSkin.Bloody:
                        GameMain.PythonSkin = PythonSkin.Pokemon;
                        break;

                    case PythonSkin.Pokemon:
                        GameMain.PythonSkin = PythonSkin.Default;
                        break;

                    default:
                        break;
                    }
                }

                // Tutorial button
                if (CollisionBtn(GameMain.BtnsStartmenu[3], x, y))
                {
                    GameMain.Gamestate = GameState.Tutorialmenu;
                }

                // Level select buttons
                for (int i = 0; i < GameMain.NLvls; i++)
                {
                    if (CollisionBtn(GameMain.BtnsLevelSelect[i], x, y))
                    {
                        if (Game2.MaxLevelAvailable >= i + 1) // only if level was unlocked already
                        {
                            Game2.LevelNr = i + 1;            // i+1 because i starts at 0 but levels start at 1
                            Game2.StartNewGame();
                        }
                    }
                }
                break;

            case GameState.Tutorialmenu:

                // Cross button
                if (CollisionBtn(GameMain.BtnsStartmenu[0], x, y))
                {
                    GameMain.self.Exit();
                }

                // Tutorial level select buttons
                for (int i = 0; i < 7; i++)
                {
                    if (CollisionBtn(GameMain.BtnsTutorialmenu[i], x, y))
                    {
                        Game2.LevelNr = i == 0 ? 101 : i + 102;     // Ex.: Array index [3] - tutlvl 105 (because 102 has no button in array)
                        Game2.StartNewGame();
                    }
                }

                // Button question mark
                if (CollisionBtn(GameMain.BtnsTutorialmenu[7], x, y))
                {
                    Game2.IsBehindTheGame = false;
                }

                // Button "Start Level 1"
                if (CollisionBtn(GameMain.BtnsTutorialmenu[8], x, y))
                {
                    Game2.LevelNr = 1;
                    Game2.StartNewGame();
                }

                // Button compiler
                if (CollisionBtn(GameMain.BtnsTutorialmenu[9], x, y))
                {
                    Game2.IsBehindTheGame = true;
                }

                // Button "Textual Manual"
                if (CollisionBtn(GameMain.BtnsTutorialmenu[10], x, y))
                {
                    GameMain.Gamestate = Game2.IsAltManual == true ? GameState.Manual : GameState.Anleitung;
                }

                // Button "Back to startmenu"
                if (CollisionBtn(GameMain.BtnsTutorialmenu[11], x, y))
                {
                    GameMain.Gamestate = GameState.Startmenu;
                }
                break;

            case GameState.Anleitung:

                if (CollisionBtn(GameMain.BtnsAnleitung[1], x, y))
                {
                    Game2.LevelNr = 1;
                    Game2.StartNewGame();
                }
                break;

            case GameState.Manual:

                if (CollisionBtn(GameMain.BtnsManual[1], x, y))
                {
                    Game2.Manualpage = 1;
                }

                if (CollisionBtn(GameMain.BtnsManual[2], x, y))
                {
                    Game2.LevelNr = 1;
                    Game2.StartNewGame();
                }
                break;

            default:

                // Button Stop
                if (CollisionBtn(GameMain.BtnsIngame[0], x, y))
                {
                    Game2.StopGame();
                    GameMain.Gamestate = Game2.LevelNr < 100 ? GameState.Startmenu : GameState.Tutorialmenu;     // return to Tutorial menu when in a Tutorial level
                }

                // Button Pause
                if (CollisionBtn(GameMain.BtnsIngame[1], x, y))
                {
                    switch (gs)     // Pause button only clickable when gamestate == Ingame || Pause
                    {
                    case GameState.Ingame:
                        GameMain.Gamestate = GameState.Pause;
                        break;

                    case GameState.Pause:
                        GameMain.Gamestate = GameState.Ingame;
                        break;
                    }
                }

                // Button Restart
                if (CollisionBtn(GameMain.BtnsIngame[2], x, y))
                {
                    Game2.RestartLevel();
                }

                // (Victory) Button Next Level
                if (gs == GameState.Victory && (Game2.LevelNr + 1 <= GameMain.NLvls || Game2.LevelNr > 100))
                {
                    if (CollisionBtn(GameMain.BtnVictory, x, y))
                    {
                        Game2.LevelNr += 1;
                        Game2.StartNewGame();
                    }
                }

                break;
            }
        }