O'Reilly logo

Monkey Game Development by Michael Hartlef

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action — modifying the HTML5 output

Again, when you have your first playable results, if you didn't do it already, do the following:

  1. Compile for HTML5.
  2. Next, open the MonkeyGame.HTML file, which is located inside the build/HTML5 folder of your project. Use Monk for it; it can open HTML files.
  3. Then, locate the line that looks like this:
    <canvas id="GameCanvas" on click="javascript:this.focus();" width=640 height=480 tabindex=1></canvas><br>
    
  4. Change the width value to 320 and the height value to 480. Then, save and close the file.

As you can see, the HTML5 canvas now has the same size as an iOS device.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required