-
Weekend Challenge: OyunJS - Turn-based game server on Node.JS
I’m pretty sure most of the people reading this blog post are familiar with both node.js and the hype around it.
I was looking for a weekend challenge and I was challenged by @enginerenturk to build a turn-based game server on node.js.
So it began.
DISCLAIMER: OyunJS is my first serious attempt at creating something with NodeJS and JavaScript.
I came home at around 8-9pm Friday night and immediately started working on the weekend challenge. I started with creating a project on Cloud9 and started with hacking together a basic HTTP server, which was ridiculously easy, being the though j2ee developer I am.
(Time references from now on refer to actual work-hour spent working.)
At around 1 hour mark, HTTP server was up and handling JSON objects in requests.
At around 10 hour mark, a basic tictactoe server was up and running, handling user joins, matching users, creating rooms.
At around 14 hour mark, I was playing tictactoe with a friend! (I built a basic html client with jQuery, communicating with nodejs over HTTP & JSON.)
At this point, I must admit, I was pretty impressed with performance and the rapid ability of nodejs to work as an application backend and decided to move on forward to see what will come out of this weekend challenge.
Some refactoring took place, made tictactoe logic an extension, fixed some bugs, cleaned up the server code, created a github account (Yeah, I know, I should have done that before.) , got a free tier micro instance from AWS, added some Facebook JS API magic, created an app on FB.
And so, here we are around ~20 hours mark.
I know OyunJS still has a very long way to go into production, many lines to code, many bugs to fix, but I’m hoping it will get somewhere nice eventually. Please don’t hesitate to contact me about any feedback, any advice, any bug or the fact, how much I suck at JS/nodejs.
Please, please do give some feedback!
Feel free to fork it/use it!
https://github.com/remzisenel/oyunjs
Remzi - @ankthepot
For the curious reader:
- Application on Facebook: http://apps.facebook.com/ticky_tacky_toe/
- “Oyun” means “Game” in Turkish.