Lexigon in your Web Browser

It’s been a while since I posted anything on wordpress. The ‘job-that-pays’ has been keeping me quite busy and then over christmas I got struck down with ‘Serious Bilateral Pneumonia’. Almost 2 weeks in hospital and think I managed to give everyone a bit of a scare. The good people at Stafford Hospital looked after me well, so a big thank you to all the staff at AMU.

Onto business, I was asked to understand web and in particular Javascript. This combined with the fact that the team at cocos2d-x have a version which is for web and HTML5 gave me a good excuse to do another port of Lexigon.

Previously I had ported the original Objective-C code with cocos2d to C++ with cocos2d-x for an Android release. There were some differences between the cocos2d and cocos2d-x when I did that port so there were one or two things I left out doing that port. This time round I took the C++ version to port to Javascript. After the initial confusion of not understanding what Javascript was the port was quite quick. Within a few days the port was done.

Problems which I hit were typically around Javascript not having types. In JS everything is a ‘var’. Yet is does have types. A painful problem I hit was a locally saved value of ‘true’ would become the string ‘true’. Later on if you read that value and compared the variable set to the string ‘true’ with the value ‘true’ the result was false. This is probably treated as a classic schoolboy error by the pro JS bunch.

The objective-C version used Apple’s GameCenter for high score, the Android version uses Scoreloop. Neither of these can be used for web. So I decided to use Facebook for the high scores. With Facebook you can submit scores, and invite friends to play the game. I added a high score table to main menu of the game where you can see your friends scores and also invite them to play.

You can play the game at http://www.lazybrush.co.uk/

You can also play in Facebook at http://apps.facebook.com/lexigon

There is a little video I made of how to play the game.

Hope you enjoy Lexigon on the web and thanks for reading!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: