Jump to content

Where to begin?


Canvas
 Share

Recommended Posts

Hello there HTML 5 Game Devs forums,

 

I'm new here so just wanted to first say I am really interested on how to create games using the HTML5 tag Canvas and with Javascript, I have create some very very basic HTML5 games which use just one JS file (bad I know ). 

 

So basically I have joined this forum looking for help (heck maybe even a mentor) on how to structure a HTML5 game, I feel like my Javascript knowledge is ok to create simple games but I am having really bad trouble with how to structure games, for example, I want to create a simple game where there is a main menu, game and game over state, the player would spawn in the middle of the screen and has to dodge objects coming towards them for as long as possible, basically like asteroids but the player can not destroy the objects. Making this wouldn't be hard at all, but writing the game in an object-orientated I just can't get my head around, I mean I would have player.js, level.js, game.js, state.js but I haven't seem any examples on how to structure a game :(.

 

Does anyone have any good tutorials or posts about how to structure a simple javascript game or feel free to example a simple way in the post here on how to structure the game I explained above :)

 

P.S. I know structuring a game is quite an open question but any input will really help me out :), quick example is having the canvas as a global variable a good idea? Or should it live inside of a Render class?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...