Beispiel #1
0
        private void mouseClicked(Rectangle mouseClickRectangle)
        {
            //index represents the number of the level that will be selected
            int index = 0;

            foreach (Button button in _levelMenu.GetButtons())
            {
                if (mouseClickRectangle.Intersects(button.CollisionRectangle))
                {
                    _game.CurrentPlayingState.SelectedLevel = (LevelType)index;
                    button.ExecuteOnClickAction();
                }
                index++;
            }
        }