Friday, October 19, 2012

Reluctant Rogue - HTML5 and leaving C#

I've wanted to get back to the Roguelike game that I spent time working on a couple of years ago. The working title for the game is "Reluctant Rogue". Since then, I have stopped coding for my day job, and have picked up much more JavaScript knowledge. I never wanted to make the game platform dependent, so I decided to start over and rewrite the game in HTML5/JavaScript.

Why HTML5/JavaScript? For one, I really like the way JavaScript and jQuery interact with elements on a page. I recently worked on digitizing a board game that some friends of mine created some time ago (You can find it at here). I wrote it entirely in HTML and JavaScript/jQuery - and it was a very cool experience. Nothing to compile, cross-browser compatible, etc. Making a game in JavaScript also has an awesome "blending of the worlds" between "drawing" and "logic". I don't have to store a separate array of the game pieces, with their locations and rotations. Instead, I use jQuery to move the pieces around on the board. This literally updates their onscreen position, rotation, etc. Want to know where a piece is? Just look it up on the board - The data is all within the pieces themselves! This way of coding flows well with functional programming and is honestly way more fun to write.

RR is a little more complicated though, involving AI, a camera, etc. I don't want to rely on CSS to space out the dungeons, so I decided to use HTML5. The canvas allows you full control of the position of the art elements.

Plus, there are some kickass JavaScript libraries out there, such as processing.js and of course, jQuery!

Finally, I don't know any HTML5. It seems like the perfect time to learn it. I also need to improve my JavaScript knowledge beyond the level of "script kiddie" - making full use of advanced JavaScript functions.

My Visual Studio license also expired recently... totally unrelated!