From 4ba6fd89ee3c19b338541d52b0729e935ea24f9d Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Sun, 3 Jun 2012 15:39:11 -0500 Subject: [PATCH] + * - Adding rotation to DrawableAxiosGameObject + * - Adding InputState extensions to test for input agaisnt Player One --- axios/Axios_WP7.csproj | 1 + axios/Axios_Windows.csproj | 1 + axios/Axios_Xbox_360.csproj | 1 + axios/Axios_settings.cs | 2 ++ axios/Engine/DrawableAxiosGameObject.cs | 12 ++++++++++-- axios/Engine/Extensions/Contact.cs | 2 -- axios/ScreenSystem/InputState.cs | 3 --- 7 files changed, 15 insertions(+), 7 deletions(-) diff --git a/axios/Axios_WP7.csproj b/axios/Axios_WP7.csproj index 9df37ff..eab21c4 100644 --- a/axios/Axios_WP7.csproj +++ b/axios/Axios_WP7.csproj @@ -169,6 +169,7 @@ + diff --git a/axios/Axios_Windows.csproj b/axios/Axios_Windows.csproj index 8d24a3f..3220790 100644 --- a/axios/Axios_Windows.csproj +++ b/axios/Axios_Windows.csproj @@ -212,6 +212,7 @@ + diff --git a/axios/Axios_Xbox_360.csproj b/axios/Axios_Xbox_360.csproj index 33ed00a..13b1156 100644 --- a/axios/Axios_Xbox_360.csproj +++ b/axios/Axios_Xbox_360.csproj @@ -162,6 +162,7 @@ + diff --git a/axios/Axios_settings.cs b/axios/Axios_settings.cs index e757991..358fa28 100644 --- a/axios/Axios_settings.cs +++ b/axios/Axios_settings.cs @@ -97,6 +97,8 @@ * - Upon some testing - developers will need to use #if WINDOWS/#endif tags to make sure they can't use XNACC in WP7/Xbox360 * - Adding axioslog command to output AxiosLog * - Changing variables in CommandConsoleBase to be non-static + * - Adding rotation to DrawableAxiosGameObject + * - Adding InputState extensions to test for input agaisnt Player One * * */ diff --git a/axios/Engine/DrawableAxiosGameObject.cs b/axios/Engine/DrawableAxiosGameObject.cs index c2c7e31..cdfc706 100644 --- a/axios/Engine/DrawableAxiosGameObject.cs +++ b/axios/Engine/DrawableAxiosGameObject.cs @@ -16,6 +16,14 @@ namespace Axios.Engine protected bool _adjustunits = true; protected bool _relativetocamera = true; + protected float _rotation; + + public float Rotation + { + get { return _rotation; } + set { _rotation = value; } + } + public bool AdjustUnits //if value changed - change position depending on adjusting the units { get { return _adjustunits; } @@ -43,9 +51,9 @@ namespace Axios.Engine else gameScreen.ScreenManager.SpriteBatch.Begin(); if (_adjustunits) - gameScreen.ScreenManager.SpriteBatch.Draw(Texture, ConvertUnits.ToDisplayUnits(Position), null, Color.White, 0, Origin, _scale, SpriteEffects.None, 0); + gameScreen.ScreenManager.SpriteBatch.Draw(Texture, ConvertUnits.ToDisplayUnits(Position), null, Color.White, _rotation, Origin, _scale, SpriteEffects.None, 0); else - gameScreen.ScreenManager.SpriteBatch.Draw(Texture, Position, null, Color.White, 0, Origin, _scale, SpriteEffects.None, 0); + gameScreen.ScreenManager.SpriteBatch.Draw(Texture, Position, null, Color.White, _rotation, Origin, _scale, SpriteEffects.None, 0); gameScreen.ScreenManager.SpriteBatch.End(); } diff --git a/axios/Engine/Extensions/Contact.cs b/axios/Engine/Extensions/Contact.cs index 7885c00..7e32fef 100644 --- a/axios/Engine/Extensions/Contact.cs +++ b/axios/Engine/Extensions/Contact.cs @@ -46,8 +46,6 @@ namespace Axios.Engine.Extensions } - - return direction; } } diff --git a/axios/ScreenSystem/InputState.cs b/axios/ScreenSystem/InputState.cs index 1ca51d7..5ad4586 100644 --- a/axios/ScreenSystem/InputState.cs +++ b/axios/ScreenSystem/InputState.cs @@ -473,7 +473,6 @@ namespace GameStateManagement } } - /// /// Helper for checking if a button was pressed during this update. /// The controllingPlayer parameter specifies which player to read input for. @@ -501,7 +500,6 @@ namespace GameStateManagement } } - /// /// Helper for checking if a key was newly pressed during this update. The /// controllingPlayer parameter specifies which player to read input for. @@ -552,7 +550,6 @@ namespace GameStateManagement } } - /// /// Helper for checking if a button was newly pressed during this update. /// The controllingPlayer parameter specifies which player to read input for.