Example #1
0
        /// <summary>
        /// Espera 7 segundos para o servidor reconhecer meu usuario e peço pra jogar
        /// </summary>
        private void StartGame()
        {
            Movements Game = new Movements();

            Thread.Sleep(7000);
            Game.JoinGame();
        }
Example #2
0
        /// <summary>
        /// Método do botão iniciar/parar de jogar. Faz as conexões com os protcolos UDP E TCP, validações  de interface e solicita pra jogar/sair.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btStartQuitGame_Click(object sender, EventArgs e)
        {
            Movements Game = new Movements();

            if (btStartQuitGame.Text == "Jogar")
            {
                tcip.UserID   = tbUser.Text;
                tcip.Password = tbPassword.Text;
                tcip.Server   = "larc.inf.furb.br";
                udp.Server    = "larc.inf.furb.br";
                udp.UserID    = tbUser.Text;
                udp.Password  = tbPassword.Text;

                btStartQuitGame.Text = "Sair";
                keepAlive            = new Thread(new ThreadStart(() => KeepAlive()));
                keepAlive.Start();
                Thread t = new Thread(new ThreadStart(() => StartGame()));
                t.Start();
            }
            else
            {
                Game.QuitGame();
                btStartQuitGame.Text = "Jogar";
                keepAlive?.Abort();
                ClearDataGrids();
            }
        }
Example #3
0
        public Elemental(Elements element, Movements movement, Vector2 pos, Vector2 velocity, Animation animation, Animation creationAnimation,
            int width, int height, int attack, int defense, int speed, int health)
        {
            this.created = false;
            this.visible = false;
            this.element = element;
            this.movement = movement;
            this.pos = pos;
            this.velocity = velocity;

            this.width = width;
            this.height = height;
            this.animation = animation;
            this.animation.TargetWidth = width;
            this.animation.TargetHeight = height;
            this.creationAnimation = creationAnimation;
            this.creationAnimation.TargetWidth = width;
            this.creationAnimation.TargetHeight = height;

            this.attack = attack;
            this.defense = defense;
            this.speed = speed;
            this.health = this.maxHealth = health;

            this.damageTimeElapsed = damageInterval;
        }
Example #4
0
        public void Move(Packet inPacket)
        {
            byte portalCount = inPacket.ReadByte();

            if (portalCount != this.PortalCount)
            {
                MainForm.Instance.Log("Character '{0}' is moving with an invalid Portal Count '{1}'.", this.Name, portalCount);
                return;
            }

            Movements movements = Movements.Parse(inPacket);

            foreach (Movement movement in movements)
            {
                if (movement is AbsoluteMovement)
                {
                    this.Position = ((AbsoluteMovement)movement).Position;
                }

                if (!(movement is EquipmentMovement))
                {
                    this.Stance = movement.NewStance;
                }
            }

            inPacket.Reset(2);

            using (Packet p = new Packet(ServerMessages.CharacterMovement))
            {
                p.WriteInt(this.ID);
                p.WriteBytes(inPacket.ReadLeftoverBytes());

                this.Field.Broadcast(p, this);
            }
        }
Example #5
0
        public void MenuRed()//Metodo para la navegacion en al redes sociales
        {
            bool status = true;

            while (status)
            {
                Console.WriteLine("<<<<<<<<<<<RECARGAR PARA REDES SOCIALES>>>>>>>>");
                Console.WriteLine("1) 500MB para solo redes sociales -------$4.00" + "\n2) Regresar" + "\n Opcion: ");
                int option = Int32.Parse(Console.ReadLine());

                switch (option)
                {
                case 1:
                    if (currentBalance >= 4)
                    {
                        Console.Write("Se han agregado 500MB para redes sociales ");
                        dataRedes += 500;
                        Movements.Add(new Movement(4, "Se agregaron 500MB"));
                    }

                    else
                    {
                        Console.WriteLine("Saldo Insuficiente");
                    }
                    break;

                case 2: break;

                default: Console.WriteLine("Opcion No valida"); break;
                }
            }
        }
Example #6
0
        public Movement MakeAMove(Player player, byte x, byte y)
        {
            // verifica se o jogo ja acabou
            if (IsFinish)
            {
                throw new InvalidOperationException("Partida finalizada");
            }

            // verifica se é a vez do jogador
            if (PlayerTurn != player)
            {
                throw new InvalidOperationException($"Não é o turno do jogador");
            }

            // verifica se posição esta disponivei
            if (Movements.Any(m => m.Position.X == x && m.Position.Y == y))
            {
                throw new InvalidOperationException("Posição já tomada anteriormente");
            }

            // Adiciona o movimento
            ToggleTurn();
            var move = new Movement(player, new Position(x, y));

            Movements.Add(move);

            // Tentamos pegar o vencedor
            Winner = GetWinner();

            return(move);
        }
Example #7
0
 private void NormalizeAllMovements(ISetOfMovements setOfMovements, double newLength)
 {
     foreach (var mov in setOfMovements.Movements)
     {
         Movements.Add(new UniversalMovement(mov, g => new NormalizedGraph(g, newLength)));
     }
 }
 /// <summary>
 ///     Trigger player crawling animation
 /// </summary>
 /// <param name="movementDirection">fwd or bwd movement</param>
 /// <param name="proneState">on front or on back prone state</param>
 private async void Crawl(Movements movementDirection, ProneStates proneState)
 {
     try
     {
         var    proneStateStr = proneState == ProneStates.OnFront ? "onfront" : "onback";
         string movementStr;
         if (proneState == ProneStates.OnFront)
         {
             movementStr = movementDirection == Movements.Forward ? "fwd" : "bwd";
         }
         else
         {
             movementStr = movementDirection == Movements.Forward ? "bwd" : "fwd";
         }
         var animStr = string.Concat(proneStateStr, "_", movementStr);
         Game.PlayerPed.Task.ClearAnimation("move_crawl", animStr);
         await Game.PlayerPed.Task.PlayAnimation("move_crawl", animStr, 8f, -8f, -1,
                                                 (AnimationFlags)2, 0);
     }
     catch (Exception ex)
     {
         Log.Error(ex);
     }
     await Task.FromResult(0);
 }
Example #9
0
        public override void PlayMusic()
        {
            bool status = true;

            while (status)
            {
                Console.WriteLine("<<<<<<<<<<<MUSICA EN SPOTIFY>>>>>>>>");
                Console.WriteLine("1) Escucgar una cancion " + "\n2) Regresar" + "\n Opcion: ");
                int option = Int32.Parse(Console.ReadLine());

                switch (option)
                {
                case 1:
                    if (ncancion >= 1)
                    {
                        Console.Write("Ingrese el nombre de la cancion: ");
                        string song = Console.ReadLine();
                        Console.WriteLine($"Reproduciendo la cancion {song} en Spotify");
                        Movements.Add(new Movement(1, $"Reproduccion  {song} en Spotify"));
                        ncancion -= 1;
                    }

                    else
                    {
                        Console.WriteLine("Ya no tiene canciones disponibles en Spotify");
                    }
                    break;

                case 2: break;

                default: Console.WriteLine("Opcion No valida"); break;
                }
            }
        }
Example #10
0
        public void NavegationWeb()//Navegacion en la Web
        {
            bool status = true;

            while (status)
            {
                Console.WriteLine("<<<<<<<<<<<NAVEGACION EN LA WEB>>>>>>>>");
                Console.WriteLine("1) Navegar en una pagina " + "\n2) Regresar" + "\n Opcion: ");
                int option = Int32.Parse(Console.ReadLine());

                switch (option)
                {
                case 1:
                    if (dataNavegation >= 4)
                    {
                        Console.Write("Ingrese el nombre de la pagina a navegar: ");
                        string webPage = Console.ReadLine();
                        Console.WriteLine($"Historial---pagina web {webPage} ");
                        dataNavegation -= 4; //restando 4 MB
                        Movements.Add(new Movement(4, $"Navegacion en {webPage}"));
                    }

                    else
                    {
                        Console.WriteLine("No tiene suficiente megas para navegar en la web");
                    }
                    break;

                case 2: break;

                default: Console.WriteLine("Opcion No valida"); break;
                }
            }
        }
Example #11
0
        //Menu para recargar navegacion general
        public void MenuWeb()
        {
            bool status = true;

            while (status)
            {
                Console.WriteLine("----------RECARGAR NAVEGACION----------");
                Console.WriteLine("1) 500MB Navegcion general \n " +
                                  "2) Regresar.");
                int option = Int32.Parse(Console.ReadLine());

                switch (option)
                {
                case 1:
                    if (currentBalance <= 5)
                    {
                        Console.WriteLine("Se han agregado 500MB para navegacion general ");
                        dataNavegation += 500;
                        Movements.Add(new Movement(5, "Se agregaron 500MB para navegacion general"));
                    }
                    else
                    {
                        Console.WriteLine("Su saldo es insuficiente");
                    } break;

                case 2: break;

                default: Console.WriteLine("Opcion invalida"); break;
                }
            }
        }
Example #12
0
        //Metodo para recargar canciones
        public void ReloadSongs()
        {
            int option;

            do
            {
                Console.WriteLine("-----Recargar Canciones-----\n" +
                                  "1) 200 canciones en Spotify -$3.00\n" +
                                  "2) Salir\n" +
                                  "Opción elegida: ");
                option = Int32.Parse(Console.ReadLine());

                switch (option)
                {
                case 1:
                    if (currentBalance >= 3)
                    {
                        Console.WriteLine("Se han agregado 200 canciones de Spotify, a disfrutar.....");
                        ncancion += 200;
                        Movements.Add(new Movement(3, "Agrego 200 canciones a Spotify"));
                    }
                    else
                    {
                        Console.WriteLine("Su saldo es insuficiente :(");
                    } break;

                case 2: break;

                default: Console.WriteLine("Opcion erronea"); break;
                }
            }while(option != 1);
        }
        public void Test_CanMove()
        {
            // Init Game
            CustomGame customGame = InitGame();

            // launch move function
            Movements move   = new Movements(null, null, customGame.Board);
            var       result = move.CanMove(new Coordinates(4, 4));

            // Tests
            Assert.IsFalse(result[DirectionType.Right]);
            Assert.IsFalse(result[DirectionType.Left]);
            Assert.IsFalse(result[DirectionType.DownRight]);
            Assert.IsFalse(result[DirectionType.DownLeft]);
            Assert.IsFalse(result[DirectionType.UpRight]);
            Assert.IsFalse(result[DirectionType.UpLeft]);


            result = move.CanMove(new Coordinates(3, 5));

            // Tests
            Assert.IsFalse(result[DirectionType.Right]);
            Assert.IsFalse(result[DirectionType.Left]);
            Assert.IsFalse(result[DirectionType.DownRight]);
            Assert.IsFalse(result[DirectionType.DownLeft]);
            Assert.IsFalse(result[DirectionType.UpRight]);
            Assert.IsFalse(result[DirectionType.UpLeft]);
        }
Example #14
0
        //Menu para recargar redes
        public void MenuRed()
        {
            bool status = true;

            while (status)
            {
                Console.WriteLine("----------RECARGAR REDES SOCIALES----------");
                Console.WriteLine("1) 500MB para redes sociales \n " +
                                  "2) Regresar.");
                int option = Int32.Parse(Console.ReadLine());

                switch (option)
                {
                case 1:
                    if (currentBalance >= 4)
                    {
                        Console.WriteLine("Se han agregado 500MB para redes sociales ");
                        dataRedes += 500;
                        Movements.Add(new Movement(4, "Se agregaron 500MB para redes sociales"));
                    }
                    else
                    {
                        Console.WriteLine("Su saldo es insuficiente");
                    } break;

                case 2: break;

                default: Console.WriteLine("Opcion invalida"); break;
                }
            }
        }
Example #15
0
        public static void HandleNpcMove(MapleClient client, InPacket iPacket)
        {
            int objectID = iPacket.ReadInt();
            Npc npc;

            try
            {
                npc = client.Character.ControlledNpcs[objectID];
            }
            catch (KeyNotFoundException)
            {
                return;
            }

            byte      a         = iPacket.ReadByte();
            byte      b         = iPacket.ReadByte();
            Movements movements = null;

            using (OutPacket oPacket = new OutPacket(SendOps.NpcMove))
            {
                oPacket
                .WriteInt(npc.ObjectID)
                .WriteByte(a)
                .WriteByte(b);

                if (npc.Data.IsMoving)
                {
                    movements = Movements.Decode(iPacket);

                    movements.Encode(oPacket);
                }

                client.Character.Map.Broadcast(oPacket);
            }
        }
Example #16
0
 void Start()
 {
     SetStop(false);
     transformMiddle_L = middle_L.GetComponent <Transform> ();
     transformMiddle_R = middle_R.GetComponent <Transform> ();
     leapMotion        = new Movements();
 }
Example #17
0
    // Save the player's movements for data collecting
    public void saveMovements(Movements playerOption)
    {
        totalChoices.Add(playerOption);
        choicesToPredict.Add(playerOption);
        choicesToRegister.Add(playerOption);

        if (choicesToPredict.Count > windowSize - 1)
        {
            choicesToPredict.RemoveAt(0);
        }

        if (choicesToRegister.Count > windowSize - 1)
        {
            if (choicesToRegister.Count > windowSize)
            {
                choicesToRegister.RemoveAt(0);
            }

            predictor.RegisterSequence(choicesToRegister);
        }


        /*if (choicesToRegister.Count > windowSize)
         * {
         *  choicesToRegister.RemoveAt(0);
         *  //predictor.RegisterSequence(choicesToRegister);
         * }*/
    }
Example #18
0
 public void Cancel()
 {
     Movements.Cancel();
     Interactives.CancelUse();
     Gathers.CancelGather();
     Teleportables.Cancel();
 }
Example #19
0
    IEnumerator Attack(Transform targetToHit)
    {
        StartCoroutine(Movements.Move(_target.transform, targetToHit, _attackingCurve, _attackingDuration, _playerYOffset, _playerRandomHitRange));
        yield return(new WaitForSeconds(_attackingDuration));

        StartCoroutine(Recover());
    }
Example #20
0
        public void ReloadSongs()
        {
            bool status = true;

            while (status)
            {
                Console.WriteLine("<<<<<<<<<<<RECARGA DE CANCIONES>>>>>>>>");
                Console.WriteLine("1) 200 canciones Spotify ---- $3.00 " + "\n2) Regresar" + "\n Opcion: ");
                int option = Int32.Parse(Console.ReadLine());

                switch (option)
                {
                case 1:
                    if (currentBalance >= 3)
                    {
                        Console.Write("Se han agregado las 200 canciones en Spotify, a disfrutar...");
                        ncancion += 200;
                        Movements.Add(new Movement(3, "Agrego 200 canciones en spotify"));
                    }

                    else
                    {
                        Console.WriteLine("Insuficiente saldo");
                    }
                    break;

                case 2: break;

                default: Console.WriteLine("Opcion No valida"); break;
                }
            }
        }
    protected virtual IEnumerator moveToNextTarget()
    {
        if (attackPlayer)
        {
            float       moveDuration = Vector2.Distance(_movingObject.transform.position, player.position) * _TimeToTargetPlayer;
            IEnumerator attack       = Movements.Move(_movingObject.transform, player, _moveCurve, moveDuration, 1.5f, 2);
            StartCoroutine(attack);
            yield return(new WaitForSeconds(moveDuration));

            StartCoroutine(moveToNextTarget());
        }
        else
        {
            GenerateRandomTarget();

            float       moveDuration = Vector2.Distance(_movingObject.transform.position, _target.transform.position) * _TimeToTarget;
            IEnumerator move         = Movements.Move(_movingObject.transform, _target.transform, _moveCurve, moveDuration);
            StartCoroutine(move);
            float timer = 0;
            while (timer < moveDuration)
            {
                if (attackPlayer)
                {
                    StopCoroutine(move);
                    timer = moveDuration;
                }
                timer += Time.deltaTime;
                yield return(null);
            }
            StartCoroutine(moveToNextTarget());
        }
    }
Example #22
0
 public TrapRec(ushort tileID, Movements escMovements, bool disposable, int escapeMsg)
 {
     TileID       = tileID;
     EscMovements = escMovements;
     Disposable   = disposable;
     EscapeMsgRS  = escapeMsg;
 }
Example #23
0
        public void Move(Packet iPacket)
        {
            byte action1 = iPacket.ReadByte();
            byte action2 = iPacket.ReadByte();

            Movements movements = null;

            if (iPacket.Remaining > 0)
            {
                movements = Movements.Decode(iPacket);
            }

            using (Packet oPacket = new Packet(ServerOperationCode.NpcMove))
            {
                oPacket
                .WriteInt(this.ObjectID)
                .WriteByte(action1)
                .WriteByte(action2);

                if (movements != null)
                {
                    oPacket.WriteBytes(movements.ToByteArray());
                }

                this.Map.Broadcast(oPacket);
            }
        }
Example #24
0
        public void Test_GetCoordinates_GetOriginDestination()
        {
            // Init Game
            CustomGame customGame = InitGame();

            // Position of cell
            int xOrigin = 0;
            int yOrigin = 0;

            // Set
            Cell cellOrigin = (Cell)customGame.Board.Board[xOrigin, yOrigin];

            cellOrigin.FishCount = 1;

            // Position of cell
            int xDestination = 1;
            int yDestination = 1;

            // Set Destination
            Cell cellDestination = (Cell)customGame.Board.Board[xDestination, yDestination];

            cellDestination.FishCount = 3;

            // Launch function
            Movements move   = new Movements(cellOrigin, cellDestination, customGame.Board);
            var       result = move.GetCoordinates();

            // Tests
            Assert.IsTrue(result["origin"].X == xOrigin);
            Assert.IsTrue(result["origin"].Y == yOrigin);
            Assert.IsTrue(result["destination"].X == xDestination);
            Assert.IsTrue(result["destination"].Y == yDestination);
        }
Example #25
0
        public void MenuNavigation()//Metodo en la navegacion de web
        {
            bool status = true;

            while (status)
            {
                Console.WriteLine("<<<<<<<<<<<RECARGAR PARA NAVEGACION EN LA WEB>>>>>>>>");
                Console.WriteLine("1) 500MB para navegacion -------$5.00" + "\n2) Regresar" + "\n Opcion: ");
                int option = Int32.Parse(Console.ReadLine());

                switch (option)
                {
                case 1:
                    if (currentBalance >= 4)
                    {
                        Console.Write("Se han agregado 500MB para navegacion web ");
                        dataNavegation += 500;
                        Movements.Add(new Movement(5, "Se agregaron 500MB navegacion para web"));
                    }

                    else
                    {
                        Console.WriteLine("Saldo Insuficiente");
                    }
                    break;

                case 2: break;

                default: Console.WriteLine("Opcion No valida"); break;
                }
            }
        }
Example #26
0
        private void GameOver()
        {
            gameTimer.Stop();

            paddleMovement        = Movements.Stop;
            gameOverLabel.Visible = true;
        }
        public void Test_CheckFreeCell_CellTypePenguin()
        {
            //Init Game
            CustomGame customGame = InitGame();

            // Position of cell origin
            int xOrigin = 0;
            int yOrigin = 0;

            //Set Origin cell
            Cell cellOrigin = (Cell)customGame.Board.Board[xOrigin, yOrigin];

            cellOrigin.CellType       = CellType.FishWithPenguin;
            cellOrigin.CurrentPenguin = new Penguin(new Player("Player1", PlayerType.Human));

            // Position of cell after
            int xAfter = 1;
            int yAfter = 0;

            //Set after cell
            Cell cellAfter = (Cell)customGame.Board.Board[xAfter, yAfter];

            cellAfter.CellType       = CellType.FishWithPenguin;
            cellAfter.CurrentPenguin = new Penguin(new Player("Player2", PlayerType.Human));

            //launch function
            Movements move   = new Movements(cellOrigin, null, customGame.Board);
            bool      result = move.CheckFreeCell(xAfter, yAfter);

            //Tests
            Assert.IsTrue(result);
        }
Example #28
0
        public override void Move(Movements direction)
        {
            var currentPosition = this.Position;

            switch (direction)
            {
                case Movements.ForwardLeft:
                    currentPosition.XCoordinate--;
                    currentPosition.YCoordinate--;
                    this.Position = currentPosition;
                    break;
                case Movements.ForwardRight:
                    currentPosition.XCoordinate++;
                    currentPosition.YCoordinate--;
                    this.Position = currentPosition;
                    break;
                case Movements.BackwardLeft:
                    currentPosition.XCoordinate--;
                    currentPosition.YCoordinate++;
                    this.Position = currentPosition;
                    break;
                case Movements.BackwardRight:
                    currentPosition.XCoordinate++;
                    currentPosition.YCoordinate++;
                    this.Position = currentPosition;
                    break;
                default:
                    throw new ArgumentOutOfRangeException("direction", direction, "Invalid Movement");
            }
        }
Example #29
0
    IEnumerator Recover()
    {
        StartCoroutine(Movements.Move(_target.transform, basePosition, _recoveringCurve, _recoveringDuration));
        yield return(new WaitForSeconds(_recoveringDuration));

        attacking = false;
    }
Example #30
0
            protected IPosition Next(IPosition pos)
            {
                var previousValue = _leeMat[pos.Y, pos.X] - 1;

                return(Movements.GetMovements(pos, 0, 0, LastX, LastY)
                       .First(p => _leeMat[p.Y, p.X] == previousValue));
            }
Example #31
0
    // Predicts the player's next move
    Movements GetMostLikely(List <Movements> actions)
    {
        DataRecord keyData;
        int        highestValue = 0;
        Movements  bestAction   = Movements.None;

        bool returnValue = data.ContainsKey(actions);

        if (returnValue)         // Has information of the serie of player's actions
        {
            keyData = data[actions];

            foreach (Movements action in keyData.counts.Keys)
            {
                if (keyData.counts[action] > highestValue)
                {
                    highestValue = keyData.counts[action];
                    bestAction   = action;
                }
            }
        }
        else // Random choice
        {
            int moveNumber = rnd.Next(1, Enum.GetNames(typeof(Movements)).Length);
            bestAction = (Movements)moveNumber;
        }

        return(bestAction);
    }
Example #32
0
 void Update()
 {
     ChangeCamera     = Leva.GetComponent <Movements> ();
     changethecamera  = ChangeCamera.changecamera;
     ChangeCamera2    = Leva1.GetComponent <Triggers2> ();
     changethecamera1 = ChangeCamera2.changecamera1;
 }
Example #33
0
    public FXLerp(GameObject target, Vector2 end, float time)
    {
        this.Target = target;
        this.Type = FX.Types.LERP;
        this.end = end;
        this.time = time;

        if (end.x == target.transform.localPosition.x &&
            end.y == target.transform.localPosition.y)
            this.movement = Movements.DIAGONAL;

        else if (end.x == target.transform.localPosition.x)
            this.movement = Movements.VERTICAL;

        else if (end.y == target.transform.localPosition.y)
            this.movement = Movements.HORIZONTAL;
    }
Example #34
0
 protected void OnControllerDisconnected(GameController.ControllerNumber cNum)
 {
     // release all movement buttons
     MoveKeyPress(Movements.All, false);
     _moveFlag = Movements.None;
     _triggersPressed = GameController.Triggers.None;
     _paused = true;
 }
                public static Movements Create(short defaultNumberOfMillisecondsToDisplayEachFrame, IEnumerable<AnimationFrame> smallInvader, IEnumerable<AnimationFrame> mediumInvader, IEnumerable<AnimationFrame> largeInvader, IEnumerable<AnimationFrame> bossInvader)
                {
                    Movements movements = new Movements();
                    movements.SmallInvader = new Animation(defaultNumberOfMillisecondsToDisplayEachFrame, smallInvader);
                    movements.MediumInvader = new Animation(defaultNumberOfMillisecondsToDisplayEachFrame, mediumInvader);
                    movements.LargeInvader = new Animation(defaultNumberOfMillisecondsToDisplayEachFrame, largeInvader);
                    movements.BossInvader = new Animation(defaultNumberOfMillisecondsToDisplayEachFrame, bossInvader);

                    return movements;
                }
Example #36
0
        void MoveKeyPress(Movements btn, bool press)
        {
            // Handling each if separately allows sending All for key up when connection lost
            // For each key, check if it's requested and that the state isn't already set
            if (btn.Has(Movements.Backward) && _moveFlag.Has(Movements.Backward) != press)
            {
                UnsafeWin32Calls.SendKeyClick(System.Windows.Input.Key.S, System.Windows.Input.ModifierKeys.None, press);
            }
            if (btn.Has(Movements.Left) && _moveFlag.Has(Movements.Left) != press)
            {
                UnsafeWin32Calls.SendKeyClick(System.Windows.Input.Key.A, System.Windows.Input.ModifierKeys.None, press);
            }
            if (btn.Has(Movements.Right) && _moveFlag.Has(Movements.Right) != press)
            {
                UnsafeWin32Calls.SendKeyClick(System.Windows.Input.Key.D, System.Windows.Input.ModifierKeys.None, press);
            }
            if (btn.Has(Movements.LeftStrafe) && _moveFlag.Has(Movements.LeftStrafe) != press)
            {
                UnsafeWin32Calls.SendKeyClick(System.Windows.Input.Key.Q, System.Windows.Input.ModifierKeys.None, press);
            }
            if (btn.Has(Movements.RightStrafe) && _moveFlag.Has(Movements.RightStrafe) != press)
            {
                UnsafeWin32Calls.SendKeyClick(System.Windows.Input.Key.E, System.Windows.Input.ModifierKeys.None, press);
            }
            if (btn.Has(Movements.Forward) && _moveFlag.Has(Movements.Forward) != press)
            {
                UnsafeWin32Calls.SendKeyClick(System.Windows.Input.Key.W, System.Windows.Input.ModifierKeys.None, press);
            }
            if (btn.Has(Movements.Up) && _moveFlag.Has(Movements.Up) != press)
            {
                UnsafeWin32Calls.SendKeyClick(System.Windows.Input.Key.Space, System.Windows.Input.ModifierKeys.None, press);
            }
            if (btn.Has(Movements.Down) && _moveFlag.Has(Movements.Down) != press)
            {
                UnsafeWin32Calls.SendKeyClick(System.Windows.Input.Key.X, System.Windows.Input.ModifierKeys.None, press);
            }

            // Update the flags
            if (press)
            {
                _moveFlag.Add(btn);
            }
            else
            {
                _moveFlag.Remove(btn);
            }
        }
 public void CreateMovements(short defaultNumberOfMillisecondsToDisplayEachFrame, IEnumerable<AnimationFrame> smallInvader, IEnumerable<AnimationFrame> mediumInvader, IEnumerable<AnimationFrame> largeInvader, IEnumerable<AnimationFrame> bossInvader)
 {
     Movement = Movements.Create(defaultNumberOfMillisecondsToDisplayEachFrame, smallInvader, mediumInvader, largeInvader, bossInvader);
 }
 public virtual void Move(Movements direction)
 {
     throw new System.NotImplementedException();
 }
Example #39
0
 public MoveEventArgs(Movements _move, int _sum, Player _player)
 {
     move = _move;
     Sum = _sum;
     player = _player;
 }
Example #40
0
 public Elemental Clone(Movements newMovement, Vector2 newPosition, Vector2 newVelocity)
 {
     return new Elemental(element, newMovement, newPosition, newVelocity, animation.Clone(), creationAnimation.Clone(),
         width, height, attack, defense, speed, maxHealth);
 }