So, my new years resolution at the beginning of 2012 was to release an app into the app-store. In the end I was one month late, however that’s good enough for me!
Paint Replay is now in the App Store – running on the iPad – just search for ‘Paint Replay’. Now let me just say, if you are looking for some awesome, all singing, all dancing paint application then this is not it – it’s just a simple paint app – but it is free and contains no ads.
MonoGame is awesome – Everyone should use it for all games from this point onwards!
MonoDevelop from Xamarin is awesome
A bit of history
So, approximately 15 months ago I bought a Mac, downloaded a copy of MonoDevelop and decided I wanted to release a game into the App Store. MonoDevelop was perfect as it meant I could program in c# (which is what I do every work day anyway) and I had no intention of learning objective-c – life is too short!
I then heard about MonoGame – a way of writing something (in c#) that could potentially run on ‘any’ platform – that sounded kind of cool so I thought I’d give it a go. The timing was perfect as I was just learning about Git – and the MonoGame source was hosted on GitHub.
Anyway, to cut a long story short, I decided to write a simple proof of concept Paint application using MonoGame before diving into developing a game. I developed enough of the app in order to create a simple picture, and then posted a time-lapse video of the picture being created to YouTube…
I was actually going to leave it at that and start looking at writing a game, however the good folks at Xamarin persuaded me to complete the Paint app.
Now, here we are some months later and it is in the App Store – and so this blog post gives a small glimpse of how I achieved that and the sort of problems I encountered along the way…
Why did it take so long?
First thing to say is that (like everything) it took a lot longer than I first anticipated, however looking back on it this should not have surprised me. I wasn’t working on this 9-5 in the office – this was a ‘in my spare time’ hobby – An odd evening here and there – indeed in the summer I think I didn’t do anything for a couple of months as I was busy enjoying the lighter evenings with the family etc. It would have been interesting to have kept track of how much time I spent on the various aspects of the development – coding – graphics – etc – certainly something I will do for future projects.
One of the problems with working on something part time in the evenings is that you kind of forget where you are from one day to the next – this invariably means it takes even more time. Also I feel that the quality of my code probably wasn’t the best – by the end of the day you are feeling more tired.
It is all too easy to add some great new feature to the development list. We’ve all suffered from this – however in this instance I only have myself to blame. With my next project I’ll certainly be establishing early on what should be in the first release and have clear estimates and goals. It’s what we do in ‘real life’ so why should it be different for pet projects!
So, let’s talk about MonoGame…
Well, this is taken from the MonoGame.net web-site and pretty much sums it up…
…MonoGame is an Open Source implementation of the Microsoft XNA 4.x Framework. Our goal is to allow XNA developers on Xbox 360, Windows & Windows Phone 7 to port their games to the iOS, Android, Mac OS X, Linux and Windows 8 Metro. OUYA, Windows Phone 8, PlayStation Mobile and Raspberry PI are currently in development…
Imagine writing a game for one platform and then easily porting it to another. If you know nothing about MonoGame then I suggest you head over to their web-site now and take a look at some of the amazing games that have been ported from one platform to another – Massive titles “Draw a Stickman” and “Bastion” are available on at least 4 different platforms by sharing huge amounts of source code between the different platform versions.
Now, I’ve only released my simple Paint Replay app on to the Apple store, but potentially a lot of the code could be re-used/ shared in order to publish it to other platforms.
Anyway, I digress…
So, I was developing my Paint app using MonoGame when I hit upon a problem. I was trying to call a method that threw a NotImplementedException. This was a big problem!
However, it actually worked out quite well because it meant that I dived into the MonoGame source – implemented the missing method and submitted a pull request. It was accepted and then everything was fine!
Of course I make it sound much simpler that it was!
At the time my knowledge of Git was not as it is today – suffice to say that I well and truly screwed up my initial attempt at the pull request. Fortunately the MonoGame guys were extremely understanding and helpful and I eventually submitted it correctly. The great thing here is that this had the side effect of improving my understanding of Git.
If you’ve downloaded my app then you may have noticed that it requires at least iOS6. This isn’t because of some new feature in iOS6 that I’m making use of. The problem I found is that the iPad rotation logic seemed to change with iOS6, which meant that my app did not rotate properly. I was almost at the stage of limiting the app to just work in landscape mode, however I eventually managed to resolve the issue – but the problem was that I had no way of knowing whether my ‘fix’ would break the app when running under iOS5 or earlier versions. I therefore set the minimum version of the app to iOS6. I’m guessing that there must be some way in MonoDevelop / xcode etc to set the iOS version that you wish to test the app under however I wasn’t sure. [As it happens I believe I do now know how to do this – something for me to try… Stack Overflow]
Once the app was complete it was time to submit it to Apple – this was the bit I was most apprehensive about. Would they come back to me with a big list of things that needed changing? Or worst still, just say ‘no’. As it happens this went extremely smoothly! 6 days after submitting my app I received an email stating that it was available for download!
If I can do it then so can you!
If you find yourself reading this blog and are thinking about developing a game then I would strongly recommend using MonoGame – it’s awesome and it’s run by a great bunch of people!
The main MonoGame web-site is monogame.net – this has links to the discussion groups/ forums and also to the source code on Github (which is free to use).
If you intend to develop for the iPad/ iPhone then you’ll need to do so on the Mac using MonoDevelop (with MonoTouch) from Xamarin. The free version of MonoDevelop / MonoTouch is fantastic – A fully functional rich IDE that lets you run your app in the iOS simulator. Eventually you’ll want to run your app on real hardware and of course publish it to the App Store at which point you’ll need to buy a license for MonoTouch and purchase an Apple Developer license (although I’d recommend that if you are looking to develop something for iOS that you actually get a license and test your app on real hardware way before you get to the point of deciding to publish it – The simulator is great but there is no substitute for testing on the real thing!). MonoTouch can be found here.
So what next?
So, next I intend to develop a game of some kind. Probably something small to start with, however it will definitely be using MonoGame! And I intend to use TDD from the outset.
If anyone is interested in looking at the source code for Paint Replay then it is on GitHub.
The web page all about Paint Replay is here.
Bye bye for now…
[EDIT: BTW – I’ve only ever tested this on an iPad 2. It should work on iPad mini, iPad 1 and an iPad retina. If anyone does have problems then leave a comment and let me know (or indeed let me know if it works fine – that would be great).]