/
codeSnips.txt
96 lines (62 loc) · 2.5 KB
/
codeSnips.txt
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//for index.html
<!DOCTYPE html>
<html style="overflow:hidden">
<head>
<title></title>
<script type="text/javascript" src="tbgs_min.js"></script>
<script type="text/javascript" src="ControllerPad.js"></script>
<link rel="stylesheet" href="ControllerPad.css" />
<style>
</style>
</head>
<body>
<div id="container" style="position:absolute;width:544px;height:320px;top:0px;margin:0px">
<div id="root" style="width:544px;height:320px;top:0px;left:0px;"> </div>
<div id="controller" > </div>
</div>
<script type="text/javascript" src="game.js"></script>
</body>
</html>
//for game.js
(function() {
//vars
class Game extends tabageos.GameSkeleton {
constructor() {
super();
var gameSpecs = {
gWidth:1088, gHeight:320,cameraWidth:544, cameraHeight:320,
cameraFollowOffsetX:-272, cameraFollowOffsetY:0, tileW:16, tileH:16,
spriteSheetImage: "", containerDivId:"container", rootDivId:"root", startLocations: new tabageos.MoverPoint(208,176),
controllerDivId:"controller", gameScale:0, useScreenOrganizer:true,startWidth:128, startHeight:32,
controllerHeight:144, initialLives:3, initPlayerPosition:new tabageos.MoverPoint(64,104), onSelectLevel:this.whenSelectLevel,
gameLoop:this.loop,initializationSpecifics:this.initialSetup, beforeStartGameLoop: this.beforeStartGame,
addedResizeMethod:null, afterSceneChange:this.levelHasChanged, priorToSceneChange:this.levelChanging, sceneChangeSpecifics:this.levelSetup,
sceneResetSpecifics:null,fullResetSpecifics:this.backToTitle, additionalSceneResetSpecifics:null,
positionResetSpecifics:this.scenePositionReset, cameraType:1, backgroundColor:"#6495ed"
};
this.dontEstablishWorkers();
this.initialConstruction(gameSpecs);
this.enableGamePad = 1;
this.establishKeyEventsForReset();
}
initialSetup = function() {
};
backToTitle = function() {
};
beforeStartGame = function() {
};
scenePositionReset = function() {
};
whenSelectLevel = function() {
};
levelSetup = function() {
};
levelChanging = function() {
};
levelHasChanged = function() {
};
loop = function() {
};
}
// new Game();
})();