예제 #1
0
        /// <summary>
        /// the direction of the fireball is taken from the mouse position in other words the projectile is launched towards the current mouse position
        /// </summary>
        private void addProjectile()
        {
            MouseState mouseState = Mouse.GetState();
            Vector2 mousePosition = new Vector2(mouseState.X,mouseState.Y);
            MissileSpell projectile = new Fireball(_game,_gameState,Position);
            projectile.CastDirection(Input.getMouseWorldPosition(mousePosition,_gameState.camera,_game.Graphics.GraphicsDevice));

            _game.Components.Add(projectile);
        }