I was looking for inspiration at GameJolt when I found a game that just reminded me that I should really scale my project even smaller since I’m just starting Unity3d. I’m starting to worry that I might have trouble submitting a game for the AppStore using the Unity3d package.
I figure that I’ll start small. I’ll make a fairly simple game similar to a Flappy Bird type of game just to see if I can submit the app. I would be devastated if I spend a huge amount of time on a game only to find that I will spend the next month trying to submit it to the AppStore.
In lieu of those thoughts, I’m going to plan the next three game as follows:
1. Simple Physics Golf Game - learn how to submit something to the stores.
2. Boxing game - learn how to do a fighting game(hitboxes and AI)
3. Samurai game - the ultimate goal.
I had to learn hard way about Unity3d’s limitations for GUI buttons for mobile devices. Above is a screenshot of a button that I just spent more than 14 hours implementing. The basic behavior of the buttons is to have 2 sprites representing the button; one for being pressed and the other one for not being pressed.
The first try was using Unity3d’s native GUI. I thought this would work great. It worked well on the my MAC but once I tested the buttons on my iPhone, my iPhone chugged. It wasn’t capturing all of my touches. Sometimes the buttons will be pressed and sometimes it wasn’t. The cause of all this is that Unity3d’s implementation of its native GUI system generates enough draw calls to slow down the CPU.
I was disappointed with Unity3d’s GUI system so I decided to write my own from scratch. I figure, how hard could it be? Create a GameObject, give it 2 children with Sprite Renderers with the “unpressed” sprite directly on top of the “pressed” sprite, make the “unpressed” sprite disappear when I click the button. Simple enough but unfortunately, something went wrong.
I couldn’t figure it out. i had the two buttons on the screen but whenever I clicked on one button, the other button gets clicked too. I spent an ungodly amount of time trying to figure it out. I thought it was some sort of Unity synching issue. Basically, whenever I click one button, the button’s script somehow messes with the other button’s Sprite Renderer. I eventually gave up because I was wasting too much time on this and I just wanted to get this done.
In the end, I bought the NGUI module from Unity’s Asset Store for $95. After spending 20 minutes watching YouTube videos on how to use NGUI to publish a simple button, I was able to implement the buttons the way I wanted to.
This whole process to get 2 buttons on the screen is COMPLETELY RIDICULOUS. This process would’ve taken me 15 minutes to code in cocos2d.
I’m still learning Unity and this game is supposed to be a learning experience. I just hope I don’t run into dumb things like this.