Finally! After many years of being a developer I get to make something to do with my favourite sport basketball!

This was a great project to work on, not just because it had to do with basketball, but I got to develop for mobile and desktop and in doing so used Adobe AIR and Unity.

Think of those basketball shooter games in the arcades – this was the goal I was going for.

The component of the game for the LG Android phone was going to be in 2D – so I decided to do this in Adobe AIR (Still makes me roll my eyes when I tell people yes you can use Flash to make apps). I used AIR as this was going to be a completely custom game with no native UI requied. Why not use Unity here also and use it’s 2D support? Well I didn’t have a Pro Android license. The desktop app I considered using AIR again and using Away3D, but I thought this was a great project to use Unity on, especially as I had recently come across a new framework for it… more on that in a moment.

For the AIR Android app I used the usual suspects in my AIR development. FDT and Robotlegs. For comms between the two apps I used OSC. For AIR I used http://bubblebird.at/tuioflash/. In Unity I used code from a previous project but I can’t remember where I first got those files or the resources I read to create them. But searching OSC and Unity does pull up some other resources if you are interested in using it.

In the few Unity projects I’ve worked on I’ve always thought a level of structure and order was missing. I am a massive fan of Robotlegs for AS3 projects with MVC and dependency injection so I thought it would be great to try find something that offers similar features. After some searching and reading I came across StrangeIOC – http://strangeioc.github.io/strangeioc/. So now that I had a Unity project I decided to try it out. After playing with some of the examples and reading through the Google Groups pages I was off and running. I can say without hesitation it lead to the most structured Unity project I’ve ever done. After getting into the flow of things I felt second nature. I would definitely recommend giving it a try.

The installation of this project was going to have 2 instances of the game running and scores were to be placed on a shared leaderboard. The backend developer I was working with created a virtual machine and placed a database on it that I then posted and retrieved data from.

The Android App.

Intro video and welcome screen.

A video would play when the game was not being played, when touched a welcome screen was presented for the player to proceed.

Name entry and countdown
Name entry and countdown

Next the player would enter their initials – after touching continue, a countdown would start, when complete the phone would vibrate and the game has started.

Taking a shot

A basketball would appear from the bottom of the screen, flicking the ball up and off the screen would act as taking a shot. The speed of the flick dictated the strength of the shot, if the ball was released to the left or right this would also change the shot and tilting the phone up and down (as indicated with the bar in the top left) would effect the angle of the shot.

Game Over

When time is up, the phone vibrates again and the final score is displayed.

The Desktop App

LG – March Madness Game from jkafkaris on Vimeo.

Watch the above video to see the result of shots being taken from the Android app. Note that the scoreboard was not connected during this video so the board is blank.

Final Game

Basketball Shooter Game from jkafkaris on Vimeo.

Here is the final game in action during final testing.

Was a great project to work on and everyone in the office that came and had a go enjoyed the fun game.

JK