• entries
    46
  • comments
    30
  • views
    51446

Starting a game in HTML5

Sign in to follow this  
shadowisadog

1065 views

So recently I have become interested in HTML5 and the new Canvas tag from a development perspective. Browser adoption is starting to catch up to the standard (although Firefox's Canvas element is still slow compares to IE9 and Chrome which is a bit lame) and HTML5 is starting to look like an attractive game/simulation development option.

My plan is to build a top down, tile based game with A* pathfinding and smooth tile scrolling. I want it to have all mouse driven interactions (following the golden rule of casual development), simple vector based graphics (created in Inkscape), and simple and laid back game play.

Starting development in such an early technology can be a bit of a dark alley. Sure there are some enterprising developers creating some game libraries for HTML5 development (such as MelonJS) and some examples/tutorials on the subject, but over all the whole thing feels a bit mysterious.

My intention is to create my own simple game framework built directly on HTML5 without using an existing game library for HTML5 and without resorting to any conversion technologies. The idea behind this is that I am not making a game for the sake of creating a game, but for the sake of learning the technology of HTML5 for multiple potential applications.

My current progress has looked at how to structure the game and what sort of IDE to use to comfortably write HTML5 content. I have settled upon Netbeans 7 as my IDE of choice. It supports HTML5 editing and has all of the tools that I need. I simply created a php project and removed any files it generated/configured my ftp settings to automatically upload the files to my webserver. It allows me to remain organized in my coding!

The only external library I am using as of late is jQuery. This is simply too helpful to pass up as it really simplifies a great number of javascript tasks such as trying to include external js files in js files (I was looking for a way to do include style statements to make the code more manageable, but some structural changes needed to be made because the call is asynchronous).

Here is a wip shot from the current title screen that I am using for testing. The game centers around a smiley face (simple art assets) on a quest to gain happiness after losing the love of its life in an IM conversation.

title-1.png

Here is some of the very basic and potentially horrible html5 im using:






Journey of a Grin



Unfortunately your browser does not support the HTML5 canvas element!



Sign in to follow this  


3 Comments


Recommended Comments

I was thinking of doing this, but thinking of using JavaScript makes me feel disgusting.

It looks like a language that makes large projects a hard to manage mess.

Share this comment


Link to comment
[quote name='CRYP7IK' timestamp='1307651022']
I was thinking of doing this, but thinking of using JavaScript makes me feel disgusting.

It looks like a language that makes large projects a hard to manage mess.
[/quote]


I am not so sure about all of that. If Javascript is not your style though there are conversion tools such as Wallaby for Flash to HTML5 conversion.In my experience so far Javascript is "different" then some other languages but different does not necessarily mean that the code will be a "hard to manage mess". I think the main thing is that you have to work with the language rather than trying to force the language to do things that it does not handle... For instance for inheritance there is prototypes however there exist a number of other schemes for inheritance as well. The more of these other schemes you use, the more hackish your code may start to appear... but it really depends on what you absolutely need!

For my game I plan to try to implement a component based architecture (having made enough games with deep inheritance hierarchies and suffered the consequences)... and yes I HAVE looked at functional reactive programming, but I am not sure if that is anything more than a vague arcane black magic that is outside the scope of mere mortals...

Share this comment


Link to comment
You do make a good point, however the way that classes \ objects, script 'includes' and whatnot are handled it just seems really really hard to manage. I mean will you be having separate script files for each 'object constructor function' because that's all a class really is in JavaScript, right?

Yeah I agree on the functional reactive programming, such high level explanations with no real examples. At my current understanding of it, it just seems like don't code functionality or generic code for the hell of it, code what you want done when you want it, which is what I do with my code...

Anywho, I will be watching your journal!

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now