Browse Source

Adding MouseAimVector to AGS

Removing Camera extension
master
Nathan Adams 9 years ago
parent
commit
719b450343
  1. 1
      axios/Axios_settings.cs
  2. 10
      axios/Engine/AxiosGameScreen.cs
  3. 11
      axios/Engine/Extensions/Camera.cs

1
axios/Axios_settings.cs

@ -117,6 +117,7 @@
* - Adding AddScreen method to ScreenManager to make the PlayerIndex optional (default of PlayerIndex.One)
* - Adding visible flag to DrawableAxiosGameObject and SimpleDrawableAxiosGameObject
* - Adding extension to mousestate (Position) to get a Vector2 object of the position
* - Added MouseAimVector to AGS - this allows you to get a vector to "shoot" with (realtive to the mouse and another object) a LinearVelocity in Farseer
*
*/
#endregion

10
axios/Engine/AxiosGameScreen.cs

@ -11,7 +11,9 @@ using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using GameStateManagement;
using Microsoft.Xna.Framework.Input;
using Axios.Engine.Gleed2D;
using Axios.Engine.Extensions;
namespace Axios.Engine
{
@ -66,6 +68,14 @@ namespace Axios.Engine
}
public Vector2 MouseAimVector(MouseState ms, Vector2 relativeposition)
{
Vector2 ret;
ret = this.Camera.ConvertScreenToWorld(ms.Position()) - relativeposition;
ret.Normalize();
return ret;
}
/*public void AddGameObject<T>(T gameobject)
{
if (gameobject is AxiosGameObject || gameobject is AxiosUIObject)

11
axios/Engine/Extensions/Camera.cs

@ -1,11 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Axios.Engine.Extensions
{
public static class Camera
{
}
}
Loading…
Cancel
Save