-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMyGame.js
36 lines (32 loc) · 1.17 KB
/
MyGame.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
TGE SPRITESHEETANIMATION OBJECTS TUTORIAL
This file demonstrates how to create, setup and control SpriteSheetAnimation
objects. In this file we are loading a spritesheet image and using it to
create a SpriteSheetAnimation object. We will also create some buttons that
will help illustrate the animation controls.
*/
MyGame = function()
{
//Main game constructor
MyGame.superclass.constructor.call(this);
//Load the spriteseet image we are using for our animated sprite
var gameAssets = [
{id:'spriteSheetImg', url:'images/spider_crawl.png'},
{id:'spriteBall', url:'images/SingleToRotation.png'},
];
this.assetManager.assignImageAssetList("required", gameAssets);
//These are default placeholder values for the buttons that will be using
TGE.Button.DefaultWidth = 150;
TGE.Button.DefaultHeight = 40;
TGE.Button.DefaultFont = "24px sans-serif";
TGE.Button.DefaultIdleColor = "#FFF";
TGE.Button.DefaultHoverColor = "#C4C4C4";
//Go to the GameScreen after loading
TGE.FirstGameWindow = GameScreen;
}
//MyGame functions
MyGame.prototype =
{
//No global functions in this tutorial
}
extend(MyGame,TGE.Game);