Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 11 commits
  • 15 files changed
  • 0 comments
  • 2 contributors
BIN  assets/audio/bird.wav
Binary file not shown
BIN  assets/audio/spring.ogg
Binary file not shown
BIN  assets/audio/spring.wav
Binary file not shown
2  src/engine/beats.js
@@ -12,7 +12,7 @@ define(["engine/loader"],
12 12 function beat() {
13 13 module.lastBeat = new Date().getTime();
14 14 for(var i in module.beatEvents) {
15   - beatEvents[i]();
  15 + module.beatEvents[i]();
16 16 }
17 17 }
18 18
4 src/engine/game-logic.js
@@ -257,8 +257,8 @@ define(["engine/schedule", "engine/debug-canvas"], function(Schedule,DebugCanvas
257 257 // process all boxCollision
258 258 ProcessBoxCollisions(elapsedTime);
259 259 ProcessEachFrame(elapsedTime);
260   - ProcessKeyEachFrame(KEY_UP, elapsedTime);
261   - //ProcessKeyEachFrame(KEY_SPACE, elapsedTime);
  260 + //ProcessKeyEachFrame(KEY_UP, elapsedTime);
  261 + ProcessKeyEachFrame(KEY_SPACE, elapsedTime);
262 262 //ProcessKeyEachFrame(KEY_W, elapsedTime);
263 263
264 264 //if (module.logic.eachFrame) {
4 src/engine/intro.js
@@ -19,8 +19,8 @@ define(["engine/loader", "engine/schedule"], function(Loader, Schedule){
19 19 setTimeout(function(){
20 20 __container.style.display = "none";
21 21 Schedule.event.dispatch("intro-complete");
22   - //}, 7000);
23   - }, 0);
  22 + }, 7000);
  23 + //}, 0);
24 24 }
25 25
26 26 };
145 src/engine/level.js
... ... @@ -1,18 +1,29 @@
1 1 define(["./game-logic", "engine/entity","engine/beats", "components/sprite", "entities/platform", "entities/monster", "entities/pigeon", "engine/loader",
2   - "text!sprites/background.json", "text!sprites/coin.json", "text!sprites/spikes.json", "text!sprites/bumper.json"],
3   - function(GameLogic, Entity, Beats, SpriteComponent, PlatformEntity, MonsterEntity, PigeonEntity, Loader, BG_SPRITE_SRC, COIN_SRC, SPIKE_SRC, BUMPER_SRC){
  2 + "text!sprites/background.json", "text!sprites/coin.json", "text!sprites/spikes.json", "text!sprites/bumper.json","text!levels/level01.json"],
  3 + function(GameLogic, Entity, Beats, SpriteComponent, PlatformEntity, MonsterEntity, PigeonEntity, Loader, BG_SPRITE_SRC, COIN_SRC, SPIKE_SRC, BUMPER_SRC, LVL01_SRC){
  4 + var loadOnce = true;
  5 + var collectSfx = null;
  6 + var springSfx = null;
  7 +
4 8 return function(setupOptions) {
5 9
6 10 var BG_SPRITE_JSON = JSON.parse(BG_SPRITE_SRC);
7 11 var COIN_JSON = JSON.parse(COIN_SRC);
8 12 var SPIKE_JSON = JSON.parse(SPIKE_SRC);
9 13 var BUMPER_JSON = JSON.parse(BUMPER_SRC);
  14 + var LVL01_JSON = JSON.parse(LVL01_SRC);
10 15 var collectSfx = null;
11 16
12 17 if( Loader.IsAudioAvailable() ) {
  18 + if (loadOnce == false)
  19 + return;
  20 + loadOnce = false;
13 21 Loader.load(Loader.Audio("assets/audio/coin.wav"), function(audio){
14 22 collectSfx = audio;
15 23 });
  24 + Loader.load(Loader.Audio("assets/audio/spring.wav"), function(audio){
  25 + springSfx = audio;
  26 + });
16 27 }
17 28
18 29 setupOptions = setupOptions || {};
@@ -91,7 +102,7 @@ define(["./game-logic", "engine/entity","engine/beats", "components/sprite", "en
91 102 collectSfx.cloneNode().play();
92 103 }
93 104 coin.collected = true;
94   - coin.upVelocity = 0.04;
  105 + coin.upVelocity = 0.2;
95 106 coin.rotationVelocity = 2*40;
96 107 setTimeout(function(){
97 108 scene.remove(coin);
@@ -105,7 +116,7 @@ define(["./game-logic", "engine/entity","engine/beats", "components/sprite", "en
105 116 this.spawnBumper = function(scene, x, y) {
106 117 var bump = new Entity({
107 118 name: "bumper",
108   - families : ["Bumper", "aHasCollisionPoints", "Physical"],
  119 + families : ["Bumper", "[removed]HasCollisionPoints", "[removed]Physical"],
109 120 collisionPoints : {
110 121 downA1: [-0.1, -0.1, 0.0],
111 122 downA2: [-0.1, -0.2, 0.0],
@@ -124,16 +135,130 @@ define(["./game-logic", "engine/entity","engine/beats", "components/sprite", "en
124 135 speed: [0,0,0],
125 136 });
126 137 bump.bumpTheShitOf = function(someEntity,elapsedTime) {
  138 + if (springSfx) {
  139 + if (!bump.hasPlayedSound)
  140 + springSfx.cloneNode().play();
  141 + bump.hasPlayedSound = true;
  142 + }
127 143 someEntity.speed[1] = 2.0;
128 144 }
129 145 GameLogic.AddGameObject(bump);
130 146 scene.add(bump);
131 147 }
132 148
  149 +
  150 +
  151 +
  152 + this.buildSceneFromJson = function(scene, lvl) { //-------------- ****
  153 + var x = setupOptions.levelOrigin[0];
  154 + // Make the platforms go lower down
  155 + var EXTEND_PLATFORMS = 15;
  156 + var RANDOM_Z = 0.05;
  157 +
  158 + for (var b in lvl.blocks) {
  159 + var floorEntity = new PlatformEntity({
  160 + position: [lvl.blocks[b].x + lvl.blocks[b].l/2
  161 + , setupOptions.levelOrigin[1] + lvl.blocks[b].y - EXTEND_PLATFORMS + 5
  162 + , -RANDOM_Z + 2*Math.random()],
  163 + width: lvl.blocks[b].l,
  164 + height: EXTEND_PLATFORMS,
  165 + moving: lvl.blocks[b].moving,
  166 + falling: false
  167 + });
  168 +
  169 + GameLogic.AddGameObject(floorEntity);
  170 + scene.add(floorEntity);
  171 + }
  172 +
  173 + for (var bump in lvl.bumpers) {
  174 + this.spawnBumper(scene, lvl.bumpers[bump].x
  175 + , setupOptions.levelOrigin[1] + lvl.bumpers[bump].y - 7.5);
  176 + }
  177 +
  178 + for (var c in lvl.coin) {
  179 + this.spawnCoin(scene, lvl.coins[c].x, lvl.coins[c].y + 6);
  180 + }
  181 +
  182 + this.buildBackground(scene);
  183 +
  184 + var monsters = 0;
  185 + var SAFE_ZONE = 5;
  186 + while(monsters--){
  187 + var monsterEntity = new MonsterEntity({
  188 + position: [SAFE_ZONE + Math.random()*(setupOptions.goalAtY-SAFE_ZONE), 115, 0],
  189 + rotation: [0, 0, 0],
  190 + });
  191 + GameLogic.AddGameObject(monsterEntity);
  192 + scene.add(monsterEntity);
  193 + }
  194 +
  195 + var pigeons = 10;
  196 + var SAFE_ZONE = 5;
  197 + while(pigeons--){
  198 + var pigeonEntity = new PigeonEntity({
  199 + position: [SAFE_ZONE + Math.random()*(setupOptions.goalAtY-SAFE_ZONE), Math.random()*3 + 8, 0],
  200 + rotation: [0, 0, 0],
  201 + });
  202 + GameLogic.AddGameObject(pigeonEntity);
  203 + scene.add(pigeonEntity);
  204 + }
  205 +
  206 +
  207 + // Make the platforms go lower down
  208 + var firstBlock = true;
  209 + while (x < setupOptions.goalAtY) {
  210 + var h = 4 + Math.random() * 4;
  211 + var w = 6 + Math.random() * 8;
  212 + // Make sure the first platform reach to 3
  213 + if (w+x < 5) {
  214 + w = 5-x;
  215 + }
  216 + x += w * 1.3;
  217 + var isMoving = false;
  218 + var isFalling = false;
  219 + if (!firstBlock && Math.random() < 0.3) {
  220 + isMoving = true;
  221 + } else if (!firstBlock && Math.random() < 0.2) {
  222 + //disabled, collision bugs
  223 + //isFalling = true;
  224 + }
  225 + var px = x;
  226 + var py = setupOptions.levelOrigin[1] + h;
  227 +
  228 + //dump( '{"x": '+px+', "y":'+py+', "l":' +w+', "isMoving":'+isMoving+'},\n');
  229 +
  230 + if (Math.random() > 0.2) {
  231 + this.spawnCoin(scene, x - w + 2*w*Math.random(), setupOptions.levelOrigin[1] + h);
  232 + }
  233 + if (Math.random() > 0.96) {
  234 + var bx = x/2 + 10;
  235 + var by = setupOptions.levelOrigin[1];
  236 + this.spawnBumper(scene, bx, by);
  237 + }
  238 + }
  239 +
  240 + Beats.beatEvents.push( function(){
  241 + if(Math.random() > 0.05) return;
  242 + var camX = scene.cubicvr.camera.position[0];
  243 + var pigeonEntity = new PigeonEntity({
  244 + position: [camX+40, Math.random()*5 + 7, 0],
  245 + rotation: [0, 0, 0],
  246 + });
  247 + GameLogic.AddGameObject(pigeonEntity);
  248 + scene.add(pigeonEntity);
  249 + });
  250 +
  251 +
  252 + };
  253 +
133 254 this.buildToScene = function(scene) {
  255 +
  256 + this.buildSceneFromJson(scene,LVL01_JSON);
  257 + return;
  258 +
134 259 var x = setupOptions.levelOrigin[0];
135 260 // Make the platforms go lower down
136   - var EXTEND_PLATFORMS = 10;
  261 + var EXTEND_PLATFORMS = 20;
137 262 var RANDOM_Z = 0.05;
138 263 var firstBlock = true;
139 264 while (x < setupOptions.goalAtY) {
@@ -152,8 +277,12 @@ define(["./game-logic", "engine/entity","engine/beats", "components/sprite", "en
152 277 //disabled, collision bugs
153 278 //isFalling = true;
154 279 }
  280 + var px = x;
  281 + var py = setupOptions.levelOrigin[1] + h;
  282 +
  283 + dump( '{"x": '+px+', "y":'+py+', "l":' +w+', "isMoving":'+isMoving+'},\n');
155 284 var floorEntity = new PlatformEntity({
156   - position: [x, setupOptions.levelOrigin[1] + h - EXTEND_PLATFORMS, -RANDOM_Z + 2*Math.random()],
  285 + position: [px, py, -RANDOM_Z + 2*Math.random()],
157 286 width: w,
158 287 height: h + EXTEND_PLATFORMS,
159 288 moving: isMoving,
@@ -165,9 +294,9 @@ define(["./game-logic", "engine/entity","engine/beats", "components/sprite", "en
165 294 if (Math.random() > 0.8) {
166 295 //this.spawnSpikes(scene, x - 0.8*w + 1.6*w*Math.random(), setupOptions.levelOrigin[1] + h);
167 296 }
168   - if (Math.random() > 0.3) {
  297 + if (Math.random() > 0.95) {
169 298 var bx = x/2 + 10;
170   - var by = setupOptions.levelOrigin[1] + 5;
  299 + var by = setupOptions.levelOrigin[1];
171 300 this.spawnBumper(scene, bx, by);
172 301 }
173 302
3  src/engine/loader.js
@@ -22,7 +22,6 @@ define(["engine/event"], function(Event){
22 22 ++loaded;
23 23 loadedItems[url] = item;
24 24
25   - console.log(loaded, toLoad);
26 25 if(loaded === toLoad){
27 26 callback(loadedItems);
28 27 }
@@ -128,4 +127,4 @@ define(["engine/event"], function(Event){
128 127
129 128 return Loader;
130 129
131   -});
  130 +});
2  src/engine/menu.js
@@ -61,4 +61,4 @@ define(["engine/schedule", "engine/beats"], function(Schedule, Beats){
61 61
62 62 };
63 63
64   -});
  64 +});
23 src/entities/pigeon.js
... ... @@ -1,10 +1,11 @@
1   -define(["engine/entity", "engine/game-logic", "components/sprite", "text!sprites/pigeon.json"],
2   - function(Entity, GameLogic, SpriteComponent, SPRITE_SRC){
  1 +define(["engine/entity", "engine/loader", "engine/game-logic", "components/sprite", "text!sprites/pigeon.json"],
  2 + function(Entity, Loader, GameLogic, SpriteComponent, SPRITE_SRC){
3 3
4 4 var SPRITE_JSON = JSON.parse(SPRITE_SRC);
5 5
6 6 var SIZE = 3.1;
7   -
  7 + var birdSfx = null;
  8 + var loadOnlyOnce = true;
8 9
9 10 GameLogic.EachFrame("Flying").push(function(p,elapsedTime){
10 11 p.position[0] -= elapsedTime/100;
@@ -15,6 +16,13 @@ define(["engine/entity", "engine/game-logic", "components/sprite", "text!sprites
15 16 return function(setupOptions){
16 17
17 18
  19 + if( Loader.IsAudioAvailable() && loadOnlyOnce ) {
  20 + loadOnlyOnce = false;
  21 + Loader.load(Loader.Audio("assets/audio/bird.wav"), function(audio){
  22 + birdSfx = audio;
  23 + });
  24 + }
  25 +
18 26 setupOptions = setupOptions || {};
19 27
20 28 var entity = new Entity({
@@ -40,6 +48,15 @@ define(["engine/entity", "engine/game-logic", "components/sprite", "text!sprites
40 48 size: [SIZE, SIZE]
41 49 });
42 50
  51 + entity.hit = function() {
  52 + if (entity.hasPlayedSound)
  53 + return;
  54 + entity.hasPlayedSound = true;
  55 + if (birdSfx) {
  56 + birdSfx.cloneNode().play();
  57 + }
  58 + }
  59 +
43 60 entity.setAnimation = function(animName) {
44 61 entity.components["sprite"].currentAnimation = animName;
45 62 }
2  src/entities/plane.js
@@ -24,7 +24,7 @@ define(["engine/entity", "engine/game-logic", "components/sprite", "engine/sched
24 24 entity.position[0] = player.position[0];
25 25 if (p.position[1] > 50)
26 26 p.position[1] = -10;
27   - p.position[0] += 0.4 * elapsedTime;
  27 + //p.position[0] += 0.4 * elapsedTime;
28 28 p.position[1] += 0.04 * elapsedTime;
29 29 //p.sceneObject.rotation[2] += 0.4 * elapsedTime;
30 30 });
2  src/entities/player.js
@@ -17,6 +17,8 @@ define(["engine/entity", "components/sprite", "engine/schedule", "text!sprites/p
17 17 //speed[0] = 0.8;
18 18 }
19 19
  20 + ///console.log("player " + p.position[0] + " " + p.position[1]);
  21 +
20 22 if(p.speed[1] < -0.001) {
21 23 p.setAnimation("jumpDown");
22 24 } else if (p.speed[1] > 0.001) {
199 src/levels/level01.json
... ... @@ -0,0 +1,199 @@
  1 +{
  2 + "foo":0,
  3 + "blocks": [
  4 + {
  5 + "x":0
  6 + , "y":4
  7 + , "l":40
  8 + , "moving": false
  9 + },
  10 + {
  11 + "x":42
  12 + , "y":6
  13 + , "l":40
  14 + , "moving": false
  15 + },
  16 + {
  17 + "x":84
  18 + , "y":10
  19 + , "l":40
  20 + , "moving": true
  21 + },
  22 + {
  23 + "x":132
  24 + , "y":30
  25 + , "l":40
  26 + , "moving": true
  27 + },
  28 + {
  29 + "x":168
  30 + , "y":10
  31 + , "l":40
  32 + , "moving": true
  33 + },
  34 + {
  35 + "x":211
  36 + , "y":9
  37 + , "l":19
  38 + , "moving": false
  39 + },
  40 + {
  41 + "x":242
  42 + , "y":11
  43 + , "l":18
  44 + , "moving": true
  45 + },
  46 + {"x": 12.5, "y":-10.907651661322621, "l":25, "isMoving":false},
  47 +{"x": 237.67035684091115, "y":4.359201033945135, "l":9.623762536450926, "isMoving":true},
  48 +{"x": 255.38773271605413, "y":3.988710272724825, "l":13.6287506731869, "isMoving":false},
  49 +{"x": 267.09026321333374, "y":4.099806807925156, "l":9.001946536368909, "isMoving":true},
  50 +{"x": 282.480707940621, "y":5.436102667748781, "l":11.838803636374815, "isMoving":true},
  51 +{"x": 293.5365612638091, "y":6.325267396861002, "l":8.50450255629855, "isMoving":false},
  52 +{"x": 309.7092197309692, "y":7.598762845373265, "l":12.440506513200067, "isMoving":false},
  53 +{"x": 320.9650483763002, "y":7.4934195032331194, "l":8.658329727177716, "isMoving":false},
  54 +{"x": 329.31591473072825, "y":7.757502933155144, "l":6.423743349560044, "isMoving":false},
  55 +{"x": 345.67317727628034, "y":5.714830907614598, "l":12.582509650424683, "isMoving":true},
  56 +{"x": 359.0156129732241, "y":4.172781684829824, "l":10.263412074572145, "isMoving":false},
  57 +{"x": 375.3629863394774, "y":4.302010297778377, "l":12.574902589425612, "isMoving":false},
  58 +{"x": 389.64731728681306, "y":7.862190234456618, "l":10.987946882565879, "isMoving":true},
  59 +{"x": 401.66822089507923, "y":4.7027604576778455, "l":9.24684892943549, "isMoving":true},
  60 +{"x": 413.4735156709899, "y":5.54850933932323, "l":9.080995981469762, "isMoving":true},
  61 +{"x": 421.30831000546067, "y":4.408315403897056, "l":6.026764872669823, "isMoving":true},
  62 +{"x": 430.52323847066316, "y":6.166119666633546, "l":7.088406511694244, "isMoving":false},
  63 +{"x": 445.5914340182328, "y":7.138020496405536, "l":11.590919651976648, "isMoving":false},
  64 +{"x": 454.6690994114254, "y":5.566932578365876, "l":6.982819533225069, "isMoving":false},
  65 +{"x": 470.6964621166819, "y":4.219989739564365, "l":12.328740542504985, "isMoving":false},
  66 +{"x": 483.76914738669467, "y":4.712273220479025, "l":10.055911746163645, "isMoving":false},
  67 +{"x": 501.5885088024701, "y":5.676180802347238, "l":13.707201089058017, "isMoving":false},
  68 +{"x": 515.3104088218955, "y":7.178749692120966, "l":10.555307707250329, "isMoving":true},
  69 +{"x": 525.749542885315, "y":4.406867208684929, "l":8.0301031257073, "isMoving":true},
  70 +{"x": 542.8636904382561, "y":5.099862842531387, "l":13.16472888687771, "isMoving":true},
  71 +{"x": 552.7831314899274, "y":6.390775645345901, "l":7.630339270516429, "isMoving":false},
  72 +{"x": 561.9792155634143, "y":7.3789405381419435, "l":7.073910825759145, "isMoving":false},
  73 +{"x": 571.1176552209549, "y":5.913431054061928, "l":7.029568967338919, "isMoving":true},
  74 +{"x": 589.1649274540792, "y":7.695554287492308, "l":13.882517102403323, "isMoving":false},
  75 +{"x": 605.4853121629991, "y":6.019366915425223, "l":12.554142083784477, "isMoving":true},
  76 +{"x": 614.478239003739, "y":5.026648844948236, "l":6.91763603133838, "isMoving":false},
  77 +{"x": 630.9120378402336, "y":5.206718053863425, "l":12.641383720380476, "isMoving":false},
  78 +{"x": 644.5009559254195, "y":4.028228250138871, "l":10.453013911681445, "isMoving":false},
  79 +{"x": 654.0881510698359, "y":7.832343382457507, "l":7.374765495704967, "isMoving":false},
  80 +{"x": 664.0932412129861, "y":7.659719256550137, "l":7.6962231870385995, "isMoving":false},
  81 +{"x": 678.2212745750259, "y":4.758462986713075, "l":10.86771797079987, "isMoving":true},
  82 +{"x": 687.6209371014763, "y":5.506276539284344, "l":7.230509635731136, "isMoving":true},
  83 +{"x": 701.5346073635184, "y":7.258383279427685, "l":10.702823278493874, "isMoving":true},
  84 +{"x": 717.6043723395567, "y":6.943504394860409, "l":12.361357673875602, "isMoving":false},
  85 +{"x": 730.3262492345116, "y":7.438531006747096, "l":9.786059149965308, "isMoving":false},
  86 +{"x": 747.7629604682697, "y":6.089089684599471, "l":13.412854795198594, "isMoving":false},
  87 +{"x": 757.5012454112106, "y":5.017517542745635, "l":7.490988417646765, "isMoving":true},
  88 +{"x": 775.2040387209087, "y":7.796106910567431, "l":13.617533315152365, "isMoving":false},
  89 +{"x": 786.3084103077948, "y":6.550552273035655, "l":8.541824297604766, "isMoving":true},
  90 +{"x": 797.288378675902, "y":4.0273621550400955, "l":8.446129513928565, "isMoving":false},
  91 +{"x": 813.9128125235763, "y":6.263831417348605, "l":12.78802603667262, "isMoving":true},
  92 +{"x": 823.7777575721695, "y":6.180398348028222, "l":7.588419268148591, "isMoving":false},
  93 +{"x": 841.8658828629202, "y":5.251066079291618, "l":13.91394253134665, "isMoving":false},
  94 +{"x": 854.4128451992636, "y":5.180215226298859, "l":9.65150948949492, "isMoving":false},
  95 +{"x": 867.9304112593394, "y":7.741531451319656, "l":10.398127738519808, "isMoving":false},
  96 +{"x": 882.7456447800968, "y":6.87740618959761, "l":11.396333477505697, "isMoving":false},
  97 +{"x": 892.5789191221284, "y":5.888672332392746, "l":7.564057186178187, "isMoving":true},
  98 +{"x": 909.324778479315, "y":6.960562165420765, "l":12.881430274758976, "isMoving":false},
  99 +{"x": 925.0600551190653, "y":6.315400801066602, "l":12.104058953654064, "isMoving":false},
  100 +{"x": 940.9546831409352, "y":6.090423132040403, "l":12.226636939899937, "isMoving":true},
  101 +{"x": 950.7061542064196, "y":6.33369003484688, "l":7.501131588834083, "isMoving":false},
  102 +{"x": 964.5069465494112, "y":5.291379398925001, "l":10.615994109993535, "isMoving":false},
  103 +{"x": 982.4678824251625, "y":4.017132854040533, "l":13.816104519808722, "isMoving":false},
  104 +{"x": 992.5859662401634, "y":5.715428719373886, "l":7.783141396154519, "isMoving":false},
  105 +{"x": 1004.7460705646719, "y":5.393520131652189, "l":9.353926403468009, "isMoving":true},
  106 +{"x": 1012.5605528713908, "y":7.074422920774848, "l":6.01114023593764, "isMoving":true},
  107 +{"x": 1025.051053249162, "y":5.483521365029969, "l":9.608077213670043, "isMoving":true},
  108 +{"x": 1043.1019151797814, "y":7.913643919855309, "l":13.88527840816886, "isMoving":true},
  109 +{"x": 1058.7947513271813, "y":6.665229391902465, "l":12.071412421076836, "isMoving":false},
  110 +{"x": 1076.3133351777858, "y":7.500192131975136, "l":13.475833731234314, "isMoving":true},
  111 +{"x": 1091.376104096684, "y":5.0108144688780385, "l":11.586745322229454, "isMoving":false},
  112 +{"x": 1100.3803189858227, "y":7.575742856244265, "l":6.926319145491285, "isMoving":false},
  113 +{"x": 1118.3719487589558, "y":6.120676438492504, "l":13.83971521010243, "isMoving":false},
  114 +{"x": 1133.5213769446348, "y":7.793967050033141, "l":11.653406296676117, "isMoving":false},
  115 +{"x": 1145.29687003554, "y":7.7773224382586505, "l":9.058071608388607, "isMoving":false},
  116 +{"x": 1161.5596484058335, "y":7.664497828853388, "l":12.509829515610427, "isMoving":true},
  117 +{"x": 1177.5518160182976, "y":5.7110393659706356, "l":12.301667394203138, "isMoving":true},
  118 +{"x": 1191.1209665818471, "y":5.817486826533681, "l":10.437808125807342, "isMoving":false},
  119 +{"x": 1201.4616638118396, "y":7.3509877939200985, "l":7.954382484609521, "isMoving":false},
  120 +{"x": 1213.602851829586, "y":7.852421657000402, "l":9.339375398266432, "isMoving":false},
  121 +{"x": 1221.7019165256552, "y":4.600887069049749, "l":6.23004976620704, "isMoving":true},
  122 +{"x": 1237.3730223172993, "y":5.573459715790618, "l":12.054696762803193, "isMoving":false},
  123 +{"x": 1254.305881393864, "y":5.0494964624699, "l":13.025276212742082, "isMoving":true},
  124 +{"x": 1268.7035773373755, "y":4.613968687219705, "l":11.075150725778013, "isMoving":false},
  125 +{"x": 1285.8611145998555, "y":4.529258999803834, "l":13.198105586523063, "isMoving":false},
  126 +{"x": 1302.8986124138507, "y":4.68844030375408, "l":13.105767549227222, "isMoving":false},
  127 +{"x": 1314.8080956705744, "y":4.632535680728189, "l":9.16114096671043, "isMoving":true},
  128 +{"x": 1323.2063681512752, "y":6.6683582175451015, "l":6.4602096005391525, "isMoving":false},
  129 +{"x": 1335.5321382536179, "y":5.294018718041977, "l":9.481361617186685, "isMoving":true},
  130 +{"x": 1350.4867816766516, "y":7.060163510735972, "l":11.503571863872088, "isMoving":true},
  131 +{"x": 1367.5768367292007, "y":5.924397190143814, "l":13.146196194268594, "isMoving":true},
  132 +{"x": 1383.7681253662145, "y":4.457974542691623, "l":12.454837413087532, "isMoving":false},
  133 +{"x": 1393.1241160030397, "y":5.038820823444469, "l":7.196915874480879, "isMoving":false},
  134 +{"x": 1404.9926386800603, "y":7.193957845228789, "l":9.129632828477334, "isMoving":true},
  135 +{"x": 1414.1886634326709, "y":7.968295626214701, "l":7.073865194315853, "isMoving":true},
  136 +{"x": 1422.8689342266177, "y":7.621591041494263, "l":6.677131379959081, "isMoving":true},
  137 +{"x": 1440.568326024501, "y":4.862779516359522, "l":13.614916767602441, "isMoving":true},
  138 +{"x": 1453.2394849208986, "y":7.578807655401054, "l":9.747045304921333, "isMoving":false},
  139 +{"x": 1465.9252212898398, "y":4.797848198340109, "l":9.758258745339383, "isMoving":true},
  140 +{"x": 1474.4327283177277, "y":7.2564162908656265, "l":6.544236175298376, "isMoving":true},
  141 +{"x": 1483.775379463316, "y":6.66949881976107, "l":7.186654727375787, "isMoving":false},
  142 +{"x": 1501.0971092917446, "y":5.940990118023719, "l":13.324407560329647, "isMoving":false},
  143 +{"x": 1511.4254997836329, "y":4.311593375749538, "l":7.944915762991029, "isMoving":false},
  144 +{"x": 1526.943112585354, "y":7.701283509618532, "l":11.936625232093062, "isMoving":true},
  145 +{"x": 1534.9790701176332, "y":4.639145880263996, "l":6.181505794061103, "isMoving":false},
  146 +{"x": 1543.5193564924878, "y":7.3148120785078286, "l":6.569451057580439, "isMoving":false},
  147 +{"x": 1559.9484526774163, "y":6.124432023273442, "l":12.637766296098812, "isMoving":true},
  148 +{"x": 1574.181308561989, "y":6.472238600887241, "l":10.948350680440553, "isMoving":true},
  149 +{"x": 1582.5931241480944, "y":6.064769667814035, "l":6.470627373927184, "isMoving":true},
  150 +{"x": 1592.1291472058415, "y":5.12973505601267, "l":7.335402352113111, "isMoving":true},
  151 +{"x": 1608.3452555266927, "y":7.958224889962389, "l":12.47392947757781, "isMoving":true},
  152 +{"x": 1617.238776118804, "y":5.03768963036366, "l":6.841169686239557, "isMoving":false},
  153 +{"x": 1630.7934025855275, "y":4.098001878451902, "l":10.426635743633334, "isMoving":true},
  154 +{"x": 1645.1744256123732, "y":6.507820148936728, "l":11.062325405265938, "isMoving":false},
  155 +{"x": 1658.9818992890998, "y":5.294276724588081, "l":10.621133597481986, "isMoving":false},
  156 +{"x": 1669.5738906881795, "y":5.5576252672664435, "l":8.147685691599794, "isMoving":true},
  157 +{"x": 1680.5933182363353, "y":7.450330638819446, "l":8.476482729350622, "isMoving":false},
  158 +{"x": 1689.3722282967053, "y":5.715806161770933, "l":6.753007738746088, "isMoving":true},
  159 +{"x": 1702.380628568479, "y":4.531720263870609, "l":10.006461747518312, "isMoving":true},
  160 +{"x": 1716.51004599603, "y":7.331347591165713, "l":10.868782636577542, "isMoving":false},
  161 +{"x": 1728.6767944017085, "y":7.272326926033646, "l":9.359037235137318, "isMoving":true},
  162 +{"x": 1746.8208565751715, "y":7.574637474525723, "l":13.956970902663821, "isMoving":true},
  163 +{"x": 1755.094146021973, "y":6.11614993381509, "l":6.364068805231872, "isMoving":false},
  164 +{"x": 1773.030980168328, "y":6.778934344884984, "l":13.797564727965316, "isMoving":false},
  165 +{"x": 1788.1125836112697, "y":7.51360231050514, "l":11.601233417647414, "isMoving":false},
  166 +{"x": 1796.3978023289644, "y":6.261561371109952, "l":6.373245167457564, "isMoving":true},
  167 +{"x": 1805.4691740819396, "y":4.748817115085624, "l":6.9779782715194285, "isMoving":false},
  168 +{"x": 1814.9675033181522, "y":5.218585251816626, "l":7.306407104778917, "isMoving":false},
  169 +{"x": 1833.0082867480405, "y":5.722660379832846, "l":13.877525715298741, "isMoving":true},
  170 +{"x": 1844.9570848303638, "y":4.277112708990201, "l":9.191383140248593, "isMoving":true},
  171 +{"x": 1862.9599972962817, "y":7.398267442060289, "l":13.848394204552271, "isMoving":true},
  172 +{"x": 1873.6182801617988, "y":4.392147405302893, "l":8.198679127320762, "isMoving":false},
  173 +{"x": 1885.5518226745278, "y":6.3356874400816725, "l":9.179648086714531, "isMoving":false},
  174 +{"x": 1893.8666647892103, "y":4.8189207988514156, "l":6.396032395909612, "isMoving":true},
  175 +{"x": 1908.9398625722588, "y":7.962618949587238, "l":11.594767525421844, "isMoving":true},
  176 +{"x": 1919.0407434008478, "y":5.0685222793818445, "l":7.769908329683838, "isMoving":false},
  177 +{"x": 1932.3519951810722, "y":4.356296634134633, "l":10.23942444632647, "isMoving":false},
  178 +{"x": 1947.0456740732777, "y":5.431619680513377, "l":11.302829917081182, "isMoving":true},
  179 +{"x": 1965.1564460320992, "y":5.366105614731396, "l":13.931363045247323, "isMoving":false},
  180 +{"x": 1978.882122952018, "y":6.312282579989773, "l":10.558213015322227, "isMoving":true},
  181 +{"x": 1989.3369061596343, "y":4.890624296914937, "l":8.042140928935513, "isMoving":true},
  182 +{"x": 2007.2035487941394, "y":6.899352813505878, "l":13.743571257311544, "isMoving":false}
  183 +
  184 +
  185 + ],
  186 + "bumpers": [
  187 + { "x":82.0, "y":6 },
  188 + { "x":126.0, "y":8 }
  189 +
  190 + ],
  191 + "coins": [
  192 + {"x":20, "y":3},
  193 + {"x":20.1, "y":3},
  194 + {"x":20.2, "y":3},
  195 + {"x":20.3, "y":3},
  196 + {"x":20.4, "y":3},
  197 + {"x":20.5, "y":3}
  198 + ]
  199 +}
13 src/main.js
@@ -22,6 +22,7 @@ require([ "engine/schedule", "engine/menu",
22 22 Loader.lock();
23 23 Menu.show();
24 24 Menu.showLoadMessage();
  25 +
25 26
26 27 var cameraSpeedDistance = 0.2;
27 28
@@ -81,6 +82,9 @@ require([ "engine/schedule", "engine/menu",
81 82 });
82 83
83 84 GameLogic.OnBoxCollision("Monster", "Player").push(function(m, p, e){
  85 + if (m.hit) {
  86 + m.hit();
  87 + }
84 88 p.hurt();
85 89 });
86 90
@@ -200,6 +204,15 @@ require([ "engine/schedule", "engine/menu",
200 204 Loader.unlock(function(){
201 205 Menu.hideLoadMessage();
202 206 Menu.showStartMessage(function(){
  207 + var elem = document.body;
  208 + if (elem.requestFullScreen) {
  209 + elem.requestFullScreen();
  210 + } else if (elem.mozRequestFullScreen) {
  211 + elem.mozRequestFullScreen();
  212 + } else if (elem.webkitRequestFullScreen) {
  213 + elem.webkitRequestFullScreen();
  214 + }
  215 +
203 216 Menu.hide();
204 217 Intro.play();
205 218 });
4 src/sprites/pigeon.json
@@ -2,7 +2,7 @@
2 2 "resource":"assets/images/pigeon.png",
3 3 "numRows": 2,
4 4 "numCols": 2,
5   - "defaultAnimation": "left",
  5 + "defaultAnimation": "right",
6 6 "animations": {
7 7 "right": {
8 8 "index":0,
@@ -15,4 +15,4 @@
15 15 "speed":4
16 16 }
17 17 }
18   -}
  18 +}

No commit comments for this range

Something went wrong with that request. Please try again.