Esempio n. 1
0
 public void JoystickButtonPressed(JoystickButtonPressedEvent e)
 {
     if (this._preventEvents)
     {
         return;
     }
     this.currentScene.HandleJoystickButtonPressed(e);
 }
Esempio n. 2
0
 public override void HandleJoystickButtonPressed(JoystickButtonPressedEvent e)
 {
     if (e.Button == JoystickButton.A)
     {
         SceneManager.Singleton.LoadScene <Stage1.Stage1>(true);
     }
     if (e.Button == JoystickButton.Back)
     {
         this.HandleCloseButtonPressed();
     }
 }
        public override void HandleJoystickButtonPressed(JoystickButtonPressedEvent e)
        {
            if (e.Button == JoystickButton.A)
            {
                selectedCharacter     = characters[index];
                EditingPlayer._sprite = new SpriteSheetContext(selectedCharacter.SourceTextureName, (uint)selectedCharacter.NumRows, (uint)selectedCharacter.NumColumns)
                {
                    RenderPosition = new OffsetVector(EditingPlayer.Position, Vector.Create(-32, -32)),
                    RenderSize     = Vector.Create(64, 64),
                    RenderColor    = selectedCharacter.RenderColor
                };

                EditingPlayer.overlay.SetColors(selectedCharacter.RenderColor);

                SceneManager.Singleton.LoadScene <Stage1.Stage1>();
            }
            if (e.Button == JoystickButton.Back)
            {
                this.HandleCloseButtonPressed();
            }
        }
Esempio n. 4
0
        public override void HandleJoystickButtonPressed(JoystickButtonPressedEvent e)
        {
            if (e.Button == JoystickButton.Back)
            {
                SceneManager.Singleton.LoadScene <MainMenu.MainMenu>();
                return;
            }

            if (e.Button == JoystickButton.A)
            {
                if (players[e.JoystickID] == null)
                {
                    this.RemoveElementById(ConnectNotification.ID);

                    var newPlayer = new Player(e.JoystickID);
                    this.players[e.JoystickID]        = newPlayer;
                    newPlayer.CollisionHandler       += this.map.GetMaximumColllisions;
                    newPlayer.BorderCollisionHandler += this.map.GetMapBorderCollisions;
                    this.map.AddEntity(newPlayer);

                    SceneManager.Singleton.LoadScene <CharacterSelection>();
                    var characterSelection = SceneManager.Singleton.CurrentScene as CharacterSelection;
                    characterSelection.EditingPlayer = this.players[e.JoystickID];

                    PlayerOverlay overlay = new PlayerOverlay(newPlayer);
                    this.AddChild(overlay);
                    newPlayer.overlay = overlay;


                    Debug.AddDebugInformation(() => $"Player {e.JoystickID} - X: {(int)newPlayer.Position.X} Y: {(int)newPlayer.Position.Y}");
                    CameraFocus(newPlayer);
                }
            }
            //attack button
            if (e.Button == JoystickButton.B)
            {
            }
        }
 public virtual void HandleJoystickButtonPressed(JoystickButtonPressedEvent e)
 {
 }