When we got here, we wanted to try and make use of a Sphero SPRK. We started out with wanting to use two leap motions as controllers and have an air hockey style game, similar to using a Xbox One kinect. When we realized that there isn't support for two leap motions on one computer, we looked elsewhere. We realized we could use an iPhone in a similar fashion to a Wii remote by taking values from it's accelerometer and gyroscope. The result was Almost Birdie, which makes use of an iPhone motion controller, and a Spheros "golf" ball.

What it does

Almost Birdie takes a new meaning to mobile gaming. Instead of looking at a phone screen, the player looks at a course, which is drawn on a sheet of paper. The player uses the iPhone as a motion controller to "hit" the Sphero. The Sphero is setup in a manner where it won't leave a distance outside a player-set starting position, allowing it to be playable anywhere with little concern for space or losing the Sphero. This allows people to increase their Putt-Putt skills without having to go commit to a full game of Putt-Putt.

How we built it

Our application consists of two parts, an iPhone motion controller for the Sphero, and a leaderboard page. The iPhone motion controller is the most advanced part. It consists of the Sphero controller, which sends commands to the Sphero letting it know how far to travel, how fast to travel, and when to stop. The iPhone motion controller also consists of reading data from the accelerometer and gyroscope. This translates the accelerometer and gyroscope data to tell the Sphero what speed, and what angle to travel at. We also built a leaderboard page. This page is deployed in Heroku, and uses angularJS2, plus expressJS. The leaderboard page takes a post from the iPhone application with how many strokes someone had to use to win, then ranks the player on a leaderboard with other people.

Challenges we ran into

The biggest challenges we ran into during development was choosing to jump from a web app to a native application. The web app was using a community javascript API built for Sphero, which had scarce, and outdate documentation. The web app also had issues with trying to get a server using web sockets going, especially since no one on the team was a web developer. Switching to a native application had it's own tradeoffs. The entire SDK was written using Obj-C, and had little to no documentation. We also only had one team member who was fluent in Obj-C, which meant a bulk of the iPhone app development was delegated to him. While he was working on the application, the rest of us worked on some swift code to handle the game loop, and tried to help with the application development when possible.

Accomplishments that we're proud of

Despite the challenges we faced, we managed to turn an iPhone into a full motion controller. Typically games use a touch based control system to accelerate, turn, aim, launch an object, etc. We decided to use the iPhone solely as a controller and the Sphero would be a ball. This allowed the iPhone to essentially disappear from the playing field and the focus really be on hitting the Sphero with the proper angle, and force to land it in the hole. The application made use of the iPhones accelerometer and gyroscope in order turn it into a wii-style controller.

What we learned

We learned to really step outside our comfort zone and use hardware we hadn't touched before. The sphero didn't have a well documented SDK, which required us to spend time delegating research to team members in order to expedite the process of making the iPhone application. We also learned about the capabilities of a smartphone as a motion controller. To us, this was a new realm of mobile gaming. Instead of staring at smartphone screens, we could use devices, like a sphero, to play mobile games with the smartphone as the controller.

What's next for Almost Birdie

We initially wanted to do some sort of augmented reality golf game using the Sphero. We would like to be able to develop an AR version of what we have with some polish. We also want users to be able to create and upload their own maps to the game. Eventually, we hope to have a native android application and possibly polish and publish the current application to the App Store.

Share this project: