Book Image

Monkey Game Development: Beginner's Guide

By : Michael Hartlef
Book Image

Monkey Game Development: Beginner's Guide

By: Michael Hartlef

Overview of this book

Monkey is a programming language and toolset that allows its user to develop modern 2D games easily for mobile and other platforms like iOS, Android, HTML5, FLASH, OSX, Windows and XNA. With Monkey you can create best selling games in a matter of weeks, instead of months.Monkey Game Development Beginner's Guide provides easy-to-follow step by step instructions on how to create eight different 2D games and how to deploy them to various platforms and markets. Learning about the structure of Monkey and how everything works together you will quickly create eight classical games and publish them to the modern app markets. Throughout the book you will learn important game development techniques like collision detection, handling player input with mouse, keyboard or touch events and creating challenging computer AI. The author explains how to emit particle effects, play sound and music files, use sprite sheets, load or save high-score tables and handle different device resolutions. Finally you will learn how to monetize your games so you can generate revenue.
Table of Contents (16 chapters)
Monkey Game Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
3
Game #2, Rocket Commander
4
Game #3, CometCrusher
5
Game #4, Chain Reaction
6
Game #5, Balls Out!
8
Game #7, Air Dogs 1942
9
Game #8, Treasure Chest

Time for action — installing Monkey


I guess it is time for the first action. If you haven't already installed Monkey, then you should do so now.

Head over to the Monkey website at http://www.monkeycoder.co.nz and grab your copy of Monkey. This book is based on the full version, so you should get that. Of course, you have to buy it first, but you won't regret this investment. And keep in mind that it is only a one-time investment. Other game creation tools are only available through subscription price models which can become very costly later on. It is not so with Monkey; you buy it once, and then you never have to pay for it again.

Ok, let's go and get it:

  1. 1. Go to http://www.monkeycoder.co.nz.

  2. 2. After you buy Monkey and sign up your user account on the website, download the latest full version from your user account.

  3. 3. Unpack the ZIP file to a location you want to run Monkey from.

    That wasn't much to do, was it? Like everything in Monkey, it is very easy to handle, even the first installation. But oh, we forget something. Something major.

  4. 4. Start Monk, to see the glorious development environment of Monkey.

Please welcome… Monk

Yes, here it is. Monk. Monkey's very own code editor.

This is the place where most of the magic will happen. The magic you will create—your own games. Your own awesome games. You still want to do it, right? Ok, then let's carry on.

When it comes to writing your Monkey code, you won't need anything else. There are other source code editors you could use to code your games with, but this book will utilize Monk for all the coding action.

How Monk works and which tools it provides you with, for your development, will be explained in Chapter 2,Getting to Know your Monkey — a Trip to the Zoo.

MSERVER—Monkey's own web server

Since Version 39, Monkey has been shipped with its own HTML server. This was necessary as certain operations required some security rights for actions such as writing the app state within an HTML app. When MServer starts, you will see a window such as the following:

Later on, when you let an HTML5 game run via Monk, MSERVER will provide you with useful information for certain actions of the game.

What just happened?

Installing Monkey is easy, right? And please note, you can copy the extracted folder to any location you want. The settings file for Monk is called monk.yourComputerName.ini and is located in the root folder of the Monkey installation. If you move the Monkey folder to a new location on your harddrive, you might want to delete it or alter the content in this file depending on the new location of Monkey.