Skip to content

Commit

Permalink
StarterKits fixes for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
KonajuGames committed Feb 17, 2012
1 parent d2a3cf5 commit 7a0bb92
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion MonoGame.StarterKits.iOS.sln
Expand Up @@ -107,7 +107,7 @@ Global
{91CF4A04-9FDC-471D-AED0-D8F057068230} = {73DDE8DB-4345-43F2-9371-0A19FC669324}
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = iOS\Platformer\Platformer.csproj
StartupItem = iOS\AlienGame\AlienGame.csproj
Policies = $0
$0.TextStylePolicy = $1
$1.RemoveTrailingWhitespace = True
Expand Down
2 changes: 0 additions & 2 deletions iOS/AlienGame/AlienGame.csproj
Expand Up @@ -45,7 +45,6 @@
<MtouchDebug>true</MtouchDebug>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchI18n />
<MtouchSdkVersion>4.0</MtouchSdkVersion>
<MtouchUseArmv7>false</MtouchUseArmv7>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
Expand All @@ -57,7 +56,6 @@
<DefineConstants>IPHONE</DefineConstants>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchI18n />
<MtouchSdkVersion>4.0</MtouchSdkVersion>
<MtouchUseArmv7>false</MtouchUseArmv7>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down
1 change: 1 addition & 0 deletions iOS/AlienGame/GameplayScreen.cs
Expand Up @@ -15,6 +15,7 @@
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;
using Microsoft.Xna.Framework.Storage;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Media;
Expand Down
3 changes: 1 addition & 2 deletions iOS/Marblets/Marblets.csproj
Expand Up @@ -45,8 +45,8 @@
<WarningLevel>4</WarningLevel>
<MtouchDebug>true</MtouchDebug>
<MtouchI18n />
<MtouchSdkVersion>4.0</MtouchSdkVersion>
<MtouchUseArmv7>false</MtouchUseArmv7>
<CodesignKey>iPhone Developer</CodesignKey>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>none</DebugType>
Expand All @@ -57,7 +57,6 @@
<DefineConstants>IPHONE</DefineConstants>
<MtouchI18n />
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchSdkVersion>4.0</MtouchSdkVersion>
<MtouchUseArmv7>false</MtouchUseArmv7>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down
4 changes: 2 additions & 2 deletions iOS/Platformer/Info.plist
Expand Up @@ -12,8 +12,8 @@
<string>3.1</string>
<key>UIDeviceFamily</key>
<array>
<string>1</string>
<string>2</string>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
Expand Down
3 changes: 1 addition & 2 deletions iOS/Platformer/Platformer.csproj
Expand Up @@ -47,10 +47,10 @@
<WarningLevel>4</WarningLevel>
<MtouchDebug>true</MtouchDebug>
<MtouchI18n />
<MtouchSdkVersion>4.0</MtouchSdkVersion>
<MtouchUseArmv7>false</MtouchUseArmv7>
<AssemblyName>Platformer</AssemblyName>
<CodesignKey>iPhone Developer</CodesignKey>
<IpaPackageName />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>none</DebugType>
Expand All @@ -61,7 +61,6 @@
<WarningLevel>4</WarningLevel>
<MtouchI18n />
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchSdkVersion>4.0</MtouchSdkVersion>
<MtouchUseArmv7>false</MtouchUseArmv7>
<AssemblyName>Platformer</AssemblyName>
</PropertyGroup>
Expand Down
13 changes: 11 additions & 2 deletions iOS/Platformer/PlatformerGame.cs
Expand Up @@ -76,7 +76,7 @@ public PlatformerGame()
graphics.IsFullScreen = true;
graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;
#endif
#if WINDOWS_PHONE
#if WINDOWS_PHONE || ANDROID || IPHONE
Accelerometer.Initialize();
#endif

Expand Down Expand Up @@ -133,18 +133,27 @@ protected override void Update(GameTime gameTime)
private void HandleInput()
{
// get all of our input states
#if !WINDOWS_PHONE && !ANDROID && !IPHONE
keyboardState = Keyboard.GetState();
#endif
#if !IPHONE
gamePadState = GamePad.GetState(PlayerIndex.One);
#endif
touchState = TouchPanel.GetState();
accelerometerState = Accelerometer.GetState();

#if !IPHONE
// Exit the game when back is pressed.
if (gamePadState.Buttons.Back == ButtonState.Pressed)
Exit();

#endif
bool continuePressed =
#if !WINDOWS_PHONE && !ANDROID && !IPHONE
keyboardState.IsKeyDown(Keys.Space) ||
#endif
#if !IPHONE
gamePadState.IsButtonDown(Buttons.A) ||
#endif
touchState.AnyTouch();

// Perform the appropriate action to advance the game and
Expand Down

0 comments on commit 7a0bb92

Please sign in to comment.