My JavaScript book is out! Don't miss the opportunity to upgrade your beginner or average dev skills.

Thursday, January 21, 2016

Playing with Sockets and Geolocation

There is a little experiment I've created more than a year ago. It's incomplete and I never got time to make it an official product and finalize it. However, somebody told me it's a freaking cool idea so I've decided to share it with you.

A Dragon Ball Z Spirit Bomb like social App

Who doesn't know or remember Goku's Spirit Bomb? He was waiting for everyone else to give him energy through both arms, putting these in a specific position and holding at the same time a sphere of power generated by his powers and the power from everyone willing to help and believing in him!

And that's pretty much the basics behind experiment.

A Simple One Button App

Once reached the main page, feel free to read how to play or simply go to the game section pressing play on the top bar. It is required to activate GeoLocation API and whatever else your device might ask, such usage of WebSockets, Audio, or Vibration.
These are the entirety of used APIs, working 100% on latest Android's Chrome browsers but also in other devices in a graceful enhanced way.
The game consists in a main power holder, which is the first person that will hold the thumb on the screen around an area of 5 to 15 meters, and people willing to give this person their power.
They should never drop the thumb from their screen until the game has been completed, which is when the power holder decides he's got enough power.
A quick demo is worth thousand words!

As Summary is an experiment based on sockets and geolocation, plus some audio and graphic effect.
The principle behind is the Spirit Bomb one from Dragon Ball Z serie: one person holds and wait for others to give him power. The score is shown on the screen (all players or all players - holder). Highest scores are registered by location in the initial screen, so it's kinda possible to break some record, as long as the single, free, dyno holding the app at Heroku works!
If interested in any technical detail, please let me know and I'll follow up with details on my better technical blog.
Have fun!

P.S. the project is not open source since it's messy and it has passwords for the PostgreSQL db and other stuff ... if there will be much interest on this project, I might consider cleaning it up and open sourcing at least the logical bits.

No comments: