Exemplo n.º 1
0
        public OptionsScreen()
            : base("")
        {
            iso = new ISOptions();
            options = new List<bool>();
            options = iso.LoadOptions("options.xml");
            if(options.Count > 0)
            {
                //indeks 0 - opcija ukljuci/isljuci muziku
                //indeks 1 - opcija ukljuci/iskljuci glazbu
                //indeks 2 - opcija ukljuci/iskljuci menu muziku
                _music = options[0];
                _menuMusic = options[2];
                _vibration = options[1];
            }
            music = new BooleanButton("Game Music", _music, "reset");
            music.Tapped += music_Tapped;
            MenuButtons.Add(music);

            menuMusic = new BooleanButton("Menu Music", _menuMusic, "reset");
            menuMusic.Tapped += MenuMusic_Tapped;
            MenuButtons.Add(menuMusic);

            vibration = new BooleanButton("Vibration", _vibration, "reset");
            vibration.Tapped += vibration_Tapped;
            MenuButtons.Add(vibration);
        }
Exemplo n.º 2
0
        public PhoneMainMenu()
            : base("")
        {
            iso = new ISOptions();
            inGamee = (bool)PhoneApplicationService.Current.State[attackGame.InGameKey];
            Button resume = new Button("", "button_resume");
            resume.Tapped += resume_Tapped;
            //if (PhoneApplicationService.Current.State[attack] == true)
            if(inGamee)
                MenuButtons.Add(resume);
            playerPosition = new Vector2(10, 10);

            Button newGame = new Button("", "button_newGame");
            newGame.Tapped += newGame_Tapped;
            MenuButtons.Add(newGame);

            Button help = new Button("", "button_help");
            help.Tapped += help_Tapped;
            MenuButtons.Add(help);

            Button highScore = new Button("", "button_highScores");
            highScore.Tapped += highScore_Tapped;
            MenuButtons.Add(highScore);

            Button options = new Button("", "button_options");
            options.Tapped += options_Tapped;
            MenuButtons.Add(options);

            Button exitButton = new Button("", "button_quit");
            exitButton.Tapped += exitButton_Tapped;
            MenuButtons.Add(exitButton);
            //Debug.WriteLine("uso je opet u jebeni kontruktor");
        }
Exemplo n.º 3
0
        public GameplayHelper(ContentManager contentManager, SpriteBatch spriteBatch, GraphicsDevice graphicsDevice)
        {
            iso = new ISOptions();
            playerHealth = 100;
            //Set player's score to zero
            score = 0;
            playerHealth = 100;
            //Enable the FreeDrag gesture.
            TouchPanel.EnabledGestures = GestureType.Tap;
            TouchPanel.EnabledGestures = GestureType.Hold;

            retTest = new Rectangle();
            widthWorld = graphicsDevice.Viewport.TitleSafeArea.Width;
            heightWorld = graphicsDevice.Viewport.TitleSafeArea.Height;
            // TODO: Perform additional initializations

            // Set the laser to fire every quarter second
            fireTime = TimeSpan.FromSeconds(.2f);

            sunPosition = new Vector2(16, 16);

            InitializeAssets(contentManager, spriteBatch, graphicsDevice);
        }