AngryTanks.Client.Player.Spawn C# (CSharp) Method

Spawn() public method

public Spawn ( Vector2 position, System.Single rotation ) : void
position Vector2
rotation System.Single
return void
        public virtual void Spawn(Vector2 position, Single rotation)
        {
            // spawning invalidates any shots that you previously had fired
            // this is possible if the respawn time is quicker than shots expire
            foreach (Shot shot in ActiveShots)
            {
                shot.End(true, false);
            }

            // set position and rotation...
            Position = newPosition = oldPosition = position;
            Rotation = newRotation = oldRotation = rotation;

            // move into alive state
            state = PlayerState.Alive;
        }