Have any questions?

+44 (20) 3540 6226

hello@appshed.com

Game Config

The most important object in every game is the "gameConfig" object.

Every game MUST have one of these objects.

This is where the main settings for the game are placed. It also holds the code to launch the game.

gameConfig

 

The Action for the gameConfig object holds the code to launch the game.

eval(app.game.run());

gameConfig action

 

For Phaser Developers

This line of JavaScript is essential, and without it the game will not run within AppShed. You can think of it as follows:

Phaser.io on web server:

var game = new Phaser.Game(config);

Phaser in AppShed

eval(app.game.run());

 
 
 

 The Action also has 4 functions:

  • preload()
  • create()
  • update()
  • redmder()

These are the 4 main functions of every Phaser game. In AppShed Game Maker, these functions appear in the gameConfig object.

However, you are not required to put anything into these functions. As shown in the image, they can be empty. Game Maker will add code to these functions behind the scenes every time you add an object to your game.

 

For Phaser Developers

You could put all your JavaScript code into gameConfig, and not add any other objects. Game Maker will run this just like a normal Phaser game.

But Game Maker will also create code behind the scenes for every object you add to your game. e.g. if you add an Image object, Game Maker adds code to the preload() function to load the asset.

Game Maker takes care of many of the "scaffolding" tasks by creating code for you.

 
 
 

 

  • Thursday, 23 May 2019

appshed name white text 250

Copyright © 2017 AppShed Limited