Jump to content

HTML5 Experts Wanted - Please Criticize Engine...


JeZxLee
 Share

Recommended Posts

HTML5 Experts Wanted - Please Criticize Engine...

 

Hi,

 

So my team and I have been working on our HTML5/JavaScript 2-D video game engine.

We were hoping some expert HTML5 coders could take a look at our HTML5 engine

and give us some feedback and suggestions for improvement?

 

You can download this HTML5 engine as a finished game at the following website URL:

www.OpenTetris.com

(full source code is downloadable on the title screen)

 

Any and all feedback is welcomed as we are not experts.

We will be using our HTML5 game engine in a official project soon.

Thank you in advance!

 

Jesse

Link to comment
Share on other sites

I had a quick look, I didnt have time to dig through the code much, it would be better for me if I could see the code hosted on Github or Bitbucket rather than poke through a download, that would be my first bit of advice. If you dont use version control at all then using git would be a good starter improvement for you guys, the benefits are plentiful and it can be a little complicated (overly so in places) but it really is fairly simple to learn once you get over the initial hurdle.

 

My 2nd bit of advice relates to the fact that you're stuffing everything in as global variables. There are a number of reasons why this is a dreadful idea, particularly when there are so many objects polluting global. Look into code modularisation, at least look at wrapping modules in immediately-invoked function expressions (google for IIFE), a single namespace variable if you must pollute global but also look at better ways for your modules to communicate— pub/sub is probably easiest to start with. Beyond that look at tools like Browserify and Webpack (there are others) to bring a module system to your coding (stay away from AMD based solutions like require.js, they're dead and they're nasty). It will help you to structure your code and your changes and will help you to white label your game engine for use in other places.

 

Beyond that, keep plugging away and improving. Finishing off a game is a great achievement and sure, there are some oddities in the tetris game, but it runs great and is very playable so thats a job done well.

Link to comment
Share on other sites

Had a quick look too, it's actually pretty nice, the general rendering seems solid at least on my macbook setup (I didn't try it on a phone), I like the way it will adjust to the screen size on the fly.

 

If you're going to throw in all global vars at the top you might as well make them window. variables - this has several massive advantages if you're planning on expanding or reusing the code later, it also allows you to call and manipulate variables from the html file for example, so you can set things up from html without having to do anything custom in the game.

 

In terms of the game itself I found the tetris wells way too narrow, why waste all that screen in the middle?

Link to comment
Share on other sites

  • 2 weeks later...

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...