Ported yesterday’s plane jam game to HTML5!

by Darius Kazemi on September 22, 2011

in html5,project

So the plane jam game I made the other day was made in GameMaker. Today, YoYo Games released GameMaker HTML5, which I purchased sight unseen because I’m that kinda guy.

Here’s the port, play it in your browser!

I was unable to do my background scrolling effect, but that’s because it was a horrible horrible hack that I put in because I was optimizing for speed of coding rather than good code (it being a plane jam and all). Overall I am very impressed with it so far! (For starters, check out the awesome texture packing it does to reduce http requests.) Of course, I love GameMaker in general, so I’m predisposed to like it, but it seems like they’re doing the right things as far as JavaScript and web dev is concerned.

It took me about 10 minutes of getting familiar with how the new tool works, and about 3o minutes of figuring out that the way I was abusing Views in GameMaker 8.1 wouldn’t fly with HTML5. But 40 minutes for a port is great!

It did take me a while to figure out where the game put the rendered HTML/JS files. I’m still not sure this is exactly where it was supposed to be, but when you compile to HTML5 on Windows 7 it’ll show you something like:

Saving HTML5 file... C:\Users\USERNAME\AppData\Local\Temp\gm_ttt_97380\html5game\Project1.js

And then just head over to that location (you want the \gm_____\ folder and everything in it), grab it and upload it!

Never mind: just go to File->Create Application. It says you’re going to make an EXE but it actually makes an HTML app instead!


Russell Kay September 22, 2011 at 9:56 am

You can just do a Create Executable (called Create HTML5) same place on the menu as it is on GM81

Darius Kazemi September 22, 2011 at 9:58 am

Thanks, amending my post now! (the “exe” dropdown selector for filetype was really confusing) Really loving the product, though. Awesome job.

Marty September 22, 2011 at 10:14 am

It’s a pretty fun little tool, eh? There are definitely some quirks to get used to, but for the most part, just about everything works just as it did in the standalone EXE apps from older versions of GameMaker.

Seeing your game just fire right up in a browser for the first time is a pretty exciting thing too. :)

OMGCarlos September 29, 2011 at 10:13 pm

Seriously the fact that it let’s us use external JS will make this thing pretty powerful. Just waiting for YoYo to bring back the “execute_script()” function and it’ll start a golden age of hobby game web development

Darius Kazemi September 30, 2011 at 11:13 am

Just curious why you want “execute_script” — generally speaking it’s not good practice to use eval-style functions (powerful though they may be). http://24ways.org/2005/dont-be-eval https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/eval#Don%27t_use_eval!

OMGCarlos September 30, 2011 at 7:41 pm

Whoa thanks for the links! I created an app before in GameMaker (see link) that made use of execute_script almost entirely. What it was, essentially, was a program that allowed to users to create GameMaker games from anything that could run the program (exe) without having GameMaker installed. In fact if you look at the screenshots it looks a lot like GM: it allows you to create and edit objects, sprites, scripts, sounds, etc. Now granted, the games created with it were slow…very. However, the fact remained that you could at least edit and test code from somewhere else without having to have GameMaker installed.

Now if I ported that idea to GMHTML5 users would be able to edit their apps from anywhere using any HTML5 compatible browser. You could start the game on the computer, edit it on your laptop while you ride the train into the city, and code in a few ideas from your mobile phone as they pop into your head – without ever having to transport resources as they are all stored on the server. You simply edit the external scripts which are stored and called via “execute_script” or “eval”. When you get home, you import your scripts into your project inside of the GMHTML5 IDE and hardcode it in, a very easy process (simply click the import scripts button)!

You would be the only one running the execute_script/eval code so you wouldn’t need to worry about malicious scripts. Unfortunately, it relies exclusively on execute_script to allow you to actually modify the code once it has been compiled and uploaded.

link: http://gmc.yoyogames.com/index.php?showtopic=496929&st=0&p=3690379&hl=oits&fromsearch=1&#entry3690379

Comments on this entry are closed.

Previous post:

Next post: