예제 #1
0
        public static AttackState ProcessPlayerAttackCharge(QueuedMove move, Player clientSimPlayer)
        {
            AttackState result = null;

            if (!move.Charging && clientSimPlayer.Charge > 0)
            {
                //attack
                result = new AttackState(Shared.MaxPlayerAttackRange * clientSimPlayer.Charge / clientSimPlayer.MaxCharge);
                clientSimPlayer.Charge = 0;
            }
            if (move.Charging)
            {
                clientSimPlayer.Charge++;
                if (clientSimPlayer.Charge > clientSimPlayer.MaxCharge)
                {
                    clientSimPlayer.Charge = clientSimPlayer.MaxCharge;
                }
            }
            return(result);
        }
예제 #2
0
 public static void ProcessMovementAndCollisions(QueuedMove move, Player clientSimPlayer, List <Shot> shots, List <int> previousHits)
 {
     clientSimPlayer.X += move.X;
     clientSimPlayer.Y += move.Y;
     CheckCollisions(clientSimPlayer, shots, previousHits, move.Tick);
 }