Skip to content

Commit

Permalink
Merge branch 'release/1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielMcAssey committed Mar 25, 2014
2 parents d5e6b08 + ce99ffd commit bf77e32
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 33 deletions.
14 changes: 2 additions & 12 deletions SolarFusion/SolarFusion/SolarFusion/Core/Input/InputHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,16 @@ static public void endUpdate()
public void AddKeyboardInput(Keys keyPressed, bool isReleased)
{
if (mKeyboard.ContainsKey(keyPressed))
{
return;
}

mKeyboard.Add(keyPressed, isReleased);
}

public void AddGamepadInput(Buttons buttonPressed, bool isReleased)
{
if (mGamepad.ContainsKey(buttonPressed))
{
return;
}

mGamepad.Add(buttonPressed, isReleased);
}

Expand All @@ -78,16 +76,12 @@ public bool IsPressed(PlayerIndex? playerIndex)
if (mKeyboard[aKey] == true)
{
if (CurrentKeyboardState.IsKeyDown(aKey) == true && PreviousKeyboardState.IsKeyDown(aKey) == false)
{
return true;
}
}
else
{
if (CurrentKeyboardState.IsKeyDown(aKey))
{
return true;
}
}
}

Expand All @@ -96,16 +90,12 @@ public bool IsPressed(PlayerIndex? playerIndex)
if (mGamepad[aButton] == true)
{
if (CurrentGamePadState[playerIndex].IsButtonDown(aButton) == true && PreviousGamePadState[playerIndex].IsButtonDown(aButton) == false)
{
return true;
}
}
else
{
if (CurrentGamePadState[playerIndex].IsButtonDown(aButton))
{
return true;
}
}
}

Expand Down
10 changes: 6 additions & 4 deletions SolarFusion/SolarFusion/SolarFusion/Core/Input/InputManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ public InputManager()
this.AddGamePadInput("NAV_SELECT", SysConfig.INPUT_GAMEPAD_SELECT, true);
this.AddGamePadInput("NAV_CANCEL", SysConfig.INPUT_GAMEPAD_CANCEL, true);

this.AddGamePadInput("GLOBAL_START", SysConfig.INPUT_GAMEPAD_START, false);
this.AddGamePadInput("GAME_PAUSE", SysConfig.INPUT_GAMEPAD_START, false);
this.AddGamePadInput("GLOBAL_START", SysConfig.INPUT_GAMEPAD_START, true);
this.AddGamePadInput("GLOBAL_DEBUG", SysConfig.INPUT_GAMEPAD_DEBUG, true);
this.AddGamePadInput("GAME_PAUSE", SysConfig.INPUT_GAMEPAD_START, true);

this.AddGamePadInput("PLAY_MOVE_LEFT", SysConfig.INPUT_GAMEPAD_LEFT_DPAD, false);
this.AddGamePadInput("PLAY_MOVE_LEFT", SysConfig.INPUT_GAMEPAD_LEFT_STICK, false);
Expand All @@ -49,8 +50,9 @@ public InputManager()
this.AddKeyboardInput("NAV_SELECT", SysConfig.INPUT_KEYBOARD_SELECT, true);
this.AddKeyboardInput("NAV_CANCEL", SysConfig.INPUT_KEYBOARD_CANCEL, true);

this.AddKeyboardInput("GLOBAL_START", SysConfig.INPUT_KEYBOARD_START, false);
this.AddKeyboardInput("GAME_PAUSE", SysConfig.INPUT_KEYBOARD_CANCEL, false);
this.AddKeyboardInput("GLOBAL_START", SysConfig.INPUT_KEYBOARD_START, true);
this.AddKeyboardInput("GLOBAL_DEBUG", SysConfig.INPUT_KEYBOARD_DEBUG, true);
this.AddKeyboardInput("GAME_PAUSE", SysConfig.INPUT_KEYBOARD_CANCEL, true);

this.AddKeyboardInput("PLAY_MOVE_LEFT", SysConfig.INPUT_KEYBOARD_LEFT, false);
this.AddKeyboardInput("PLAY_MOVE_RIGHT", SysConfig.INPUT_KEYBOARD_RIGHT, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ public LevelTilemap CurrentGameMap
{
get { return this._obj_map; }
}

public bool Debug
{
get { return this.mDebugEnabled; }
set { this.mDebugEnabled = value; }
}
#endregion
// !Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,16 @@ public override void update()

public override void render()
{
// Draw the selected entry in yellow, otherwise white.
Color tmenuimgclr = Color.White;

// Modify the alpha to fade text out during transitions.
tmenuimgclr *= this.CurrentTransitionAlpha;

base.render();
this.ScreenManager.SpriteBatch.Begin();

for (int i = 0; i < this.mCreditList.Count; i++)
this.ScreenManager.SpriteBatch.DrawString(this.ScreenManager.DefaultGUIFont, this.mCreditList[i].FullString, this.mCreditList[i].TextPosition, Color.White, 0f, this.mCreditList[i].TextOrigin, this.mTextScale, SpriteEffects.None, 0f);
this.ScreenManager.SpriteBatch.DrawString(this.ScreenManager.DefaultGUIFont, this.mCreditList[i].FullString, this.mCreditList[i].TextPosition, tmenuimgclr, 0f, this.mCreditList[i].TextOrigin, this.mTextScale, SpriteEffects.None, 0f);

this.ScreenManager.SpriteBatch.End();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ public override void update() //Update per frame
if (this.GlobalInput.IsPressed("PLAY_WEAPON_FIRE", this.ControllingPlayer)) //If player presses the jump button (Spacebar/A)
this._obj_activeplayer.fire();

if (this.GlobalInput.IsPressed("GLOBAL_DEBUG", this.ControllingPlayer)) //If player presses the jump button (Spacebar/A)
this._obj_levelmanager.Debug = !this._obj_levelmanager.Debug;

base.update();
}

Expand Down
2 changes: 2 additions & 0 deletions SolarFusion/SolarFusion/SolarFusion/Core/SysConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public class SysConfig

public const Buttons INPUT_GAMEPAD_JUMP = Buttons.A;
public const Buttons INPUT_GAMEPAD_FIRE = Buttons.RightShoulder;
public const Buttons INPUT_GAMEPAD_DEBUG = Buttons.RightStick;

//Default Keyboard Controls
public const Keys INPUT_KEYBOARD_UP = Keys.Up;
Expand All @@ -77,5 +78,6 @@ public class SysConfig

public const Keys INPUT_KEYBOARD_JUMP = Keys.Space;
public const Keys INPUT_KEYBOARD_FIRE = Keys.X;
public const Keys INPUT_KEYBOARD_DEBUG = Keys.F2;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@
<playerScale>1</playerScale>
<maxFrameCount>10</maxFrameCount>
<playerAnimations>
<Item>right</Item>
<Item>left</Item>
<Item>right</Item>
<Item>idle</Item>
</playerAnimations>
<playerAnimationFrameCount>
<Item>10</Item>
<Item>10</Item>
<Item>3</Item>
<Item>8</Item>
</playerAnimationFrameCount>
<playerAnimationsFPS>
<Item>
<Key>right</Key>
<Value>15</Value>
<Key>left</Key>
<Value>5</Value>
</Item>
<Item>
<Key>left</Key>
<Value>15</Value>
<Key>right</Key>
<Value>5</Value>
</Item>
<Item>
<Key>idle</Key>
<Value>1</Value>
<Value>3</Value>
</Item>
</playerAnimationsFPS>
<moveSpeed>1.8</moveSpeed>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<XnaContent>
<Asset Type="System.String[]">
<Item>dr_jumpista</Item>
<!-- <Item>asterix</Item> -->
<Item>asterix</Item>
</Asset>
</XnaContent>
Original file line number Diff line number Diff line change
Expand Up @@ -1094,13 +1094,6 @@
<Processor>TextureProcessor</Processor>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="Sprites\Characters\asterix\spritesheet.png">
<Name>spritesheet</Name>
<Importer>TextureImporter</Importer>
<Processor>TextureProcessor</Processor>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="Sprites\Objects\Animated\warp\spritesheet.png">
<Name>spritesheet</Name>
Expand Down Expand Up @@ -1157,6 +1150,14 @@
<Processor>TextureProcessor</Processor>
</Compile>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Compile Include="Sprites\Characters\asterix\spritesheet.png">
<Name>spritesheet</Name>
<Importer>TextureImporter</Importer>
<Processor>TextureProcessor</Processor>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bf77e32

Please sign in to comment.