Skip to content

Commit

Permalink
Began porting to iOS. Starting to run, but lots of bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
praeclarum committed Aug 5, 2012
1 parent 12231d3 commit 7000fa9
Show file tree
Hide file tree
Showing 13 changed files with 877 additions and 8 deletions.
Binary file removed .DS_Store
Binary file not shown.
10 changes: 5 additions & 5 deletions .gitignore
@@ -1,7 +1,7 @@
*.user *.user
*.userprefs
*.suo *.suo
BearGame/BearGame/bin/ .DS_Store
BearGame/BearGame/obj/ bin
BearGame/BearGameContent/bin/ obj
BearGame/BearGameContent/obj/
*.cachefile *.cachefile
Binary file removed BearGame/.DS_Store
Binary file not shown.
4 changes: 3 additions & 1 deletion BearGame/BearGame/Achievement.cs
Expand Up @@ -43,7 +43,9 @@ public virtual void Update(GameTime time)
{ {
_showTime = now; _showTime = now;
IsVisible = true; IsVisible = true;
AchievementSound.Play(); if (AchievementSound != null) {
AchievementSound.Play();
}
} }
} }
} }
Expand Down
16 changes: 16 additions & 0 deletions BearGame/BearGame/GameState.cs
Expand Up @@ -95,7 +95,11 @@ public override void LoadContent(GraphicsDevice graphics, ContentManager Content
Daredevil.DaredevilSound = new RandomSound(Content, "Audio\\thump_01", "Audio\\thump_02", "Audio\\thump_03"); Daredevil.DaredevilSound = new RandomSound(Content, "Audio\\thump_01", "Audio\\thump_02", "Audio\\thump_03");
RunOver.TricycleBodyImpactSound = new RandomSound(Content, "Audio\\tricycle_body_impact_01"); RunOver.TricycleBodyImpactSound = new RandomSound(Content, "Audio\\tricycle_body_impact_01");
Honey._beehiveBuzz = Content.Load<SoundEffect>("Audio\\beehive_buzz_01"); Honey._beehiveBuzz = Content.Load<SoundEffect>("Audio\\beehive_buzz_01");

#if IOS
#else
Achievement.AchievementSound = new RandomSound(Content, "Audio\\Achievement-mp3-sound"); Achievement.AchievementSound = new RandomSound(Content, "Audio\\Achievement-mp3-sound");
#endif


Bear.bearGruntSound = new RandomSound(Content, "Audio\\bear_desperate_whining_01", "Audio\\bear_desperate_whining_02", "Audio\\bear_desperate_whining_03", "Audio\\bear_desperate_whining_04", "Audio\\bear_desperate_whining_05"); Bear.bearGruntSound = new RandomSound(Content, "Audio\\bear_desperate_whining_01", "Audio\\bear_desperate_whining_02", "Audio\\bear_desperate_whining_03", "Audio\\bear_desperate_whining_04", "Audio\\bear_desperate_whining_05");
Bear.bearHappySound = new RandomSound(Content, "Audio\\bear_happy_singing_01", "Audio\\bear_happy_singing_02", "Audio\\bear_happy_singing_03"); Bear.bearHappySound = new RandomSound(Content, "Audio\\bear_happy_singing_01", "Audio\\bear_happy_singing_02", "Audio\\bear_happy_singing_03");
Expand Down Expand Up @@ -267,7 +271,10 @@ public override void LoadContent(GraphicsDevice graphics, ContentManager Content
_woosh = Content.Load<SoundEffect>("Audio\\whoosh_01"); _woosh = Content.Load<SoundEffect>("Audio\\whoosh_01");


// make me a font for the intro // make me a font for the intro
#if IOS
#else
introFont = Content.Load<SpriteFont>("UI\\IntroFont"); introFont = Content.Load<SpriteFont>("UI\\IntroFont");
#endif


//load images for the intro //load images for the intro
SplashScreen tempSplash = new SplashScreen(Content.Load<Texture2D>("SplashUI\\Splash_Steam"), 700,300, 300); SplashScreen tempSplash = new SplashScreen(Content.Load<Texture2D>("SplashUI\\Splash_Steam"), 700,300, 300);
Expand Down Expand Up @@ -522,7 +529,10 @@ public override void LoadContent(GraphicsDevice graphics, ContentManager Content
_uiBatch = new SpriteBatch(graphics); _uiBatch = new SpriteBatch(graphics);


// make me a font for the intro // make me a font for the intro
#if IOS
#else
introFont = Content.Load<SpriteFont>("UI\\UIFont"); introFont = Content.Load<SpriteFont>("UI\\UIFont");
#endif




// testing, read from file or something later? // testing, read from file or something later?
Expand Down Expand Up @@ -637,7 +647,10 @@ public override void LoadContent(GraphicsDevice graphics, ContentManager Content
_uiBatch = new SpriteBatch(graphics); _uiBatch = new SpriteBatch(graphics);


// make me a font for the intro // make me a font for the intro
#if IOS
#else
introFont = Content.Load<SpriteFont>("UI\\UIFont"); introFont = Content.Load<SpriteFont>("UI\\UIFont");
#endif




// testing, read from file or something later? // testing, read from file or something later?
Expand Down Expand Up @@ -817,7 +830,10 @@ public override void LoadContent(GraphicsDevice graphics, ContentManager Content
_uiBatch = new SpriteBatch(graphics); _uiBatch = new SpriteBatch(graphics);


// make me a font for the intro // make me a font for the intro
#if IOS
#else
introFont = Content.Load<SpriteFont>("UI\\UIFont"); introFont = Content.Load<SpriteFont>("UI\\UIFont");
#endif




// testing, read from file or something later? // testing, read from file or something later?
Expand Down
7 changes: 6 additions & 1 deletion BearGame/BearGame/GameView.cs
Expand Up @@ -67,7 +67,10 @@ public void LoadContent(GraphicsDevice device, ContentManager content)
_persondeadTexture = content.Load<Texture2D>("UI\\facesDead"); _persondeadTexture = content.Load<Texture2D>("UI\\facesDead");


//Load Fonts //Load Fonts
#if IOS
#else
_uiFont = content.Load<SpriteFont>("UI\\UIFont"); _uiFont = content.Load<SpriteFont>("UI\\UIFont");
#endif


//Load UI_Items //Load UI_Items
_uiitemhoneyTexture = content.Load<Texture2D>("UI\\Honey"); _uiitemhoneyTexture = content.Load<Texture2D>("UI\\Honey");
Expand Down Expand Up @@ -149,7 +152,9 @@ public void Draw()


} }
_uiBatch.Draw(healthTexture, new Rectangle(xPeople, yPeople + (70 * (_world.AllVillagers.IndexOf(person))), 64, 64), Color.White); _uiBatch.Draw(healthTexture, new Rectangle(xPeople, yPeople + (70 * (_world.AllVillagers.IndexOf(person))), 64, 64), Color.White);
_uiBatch.DrawString(_uiFont, person.Name.ToString(), new Vector2(xPeople + 70, yPeople + 20 + (70 * (_world.AllVillagers.IndexOf(person)))), fontColor); if (_uiFont != null) {
_uiBatch.DrawString(_uiFont, person.Name.ToString(), new Vector2(xPeople + 70, yPeople + 20 + (70 * (_world.AllVillagers.IndexOf(person)))), fontColor);
}
} }


//Draw Inventory Item //Draw Inventory Item
Expand Down
3 changes: 2 additions & 1 deletion BearGame/BearGame/Layer.cs
Expand Up @@ -20,7 +20,8 @@ public char GetTile(int column, int row)


public void LoadTiles(string path) public void LoadTiles(string path)
{ {
using (var reader = File.OpenText(path)) var cleanPath = path.Replace ('\\', System.IO.Path.DirectorySeparatorChar);
using (var reader = File.OpenText(cleanPath))
{ {
_rows = new List<string>(); _rows = new List<string>();
for (var line = reader.ReadLine(); line != null; line = reader.ReadLine()) for (var line = reader.ReadLine(); line != null; line = reader.ReadLine())
Expand Down
Binary file removed BearGame/BearGameContent/.DS_Store
Binary file not shown.
21 changes: 21 additions & 0 deletions BearGame/BearGameiOS/AppDelegate.cs
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;

using MonoTouch.Foundation;
using MonoTouch.UIKit;

namespace BearGame.iOS
{
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
var game = new Game1 ();
game.Run ();
return true;
}
}
}

0 comments on commit 7000fa9

Please sign in to comment.