2018-03-05 17:38:12 +01:00
|
|
|
if (this.parentEntity === data.entity) {
|
|
|
|
console.log('Entity Impact Test Loaded');
|
|
|
|
} else {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-03-12 08:22:29 +01:00
|
|
|
if (!this.initialized) {
|
2018-03-05 17:38:12 +01:00
|
|
|
this.initialized = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ig.module(
|
|
|
|
'game.impact-test'
|
|
|
|
)
|
|
|
|
.requires(
|
|
|
|
'impact.font',
|
|
|
|
'impact.game',
|
|
|
|
'impact.image',
|
|
|
|
'game.levels.snake'
|
|
|
|
)
|
|
|
|
.defines(function(){
|
|
|
|
|
|
|
|
// code for this module
|
|
|
|
|
|
|
|
// Create your own game class
|
|
|
|
ig.global.Snake = ig.Game.extend(
|
|
|
|
|
|
|
|
{
|
|
|
|
font: new ig.Font( 'media/04b03.font.png' ),
|
|
|
|
|
2018-03-12 08:40:21 +01:00
|
|
|
background: new ig.Image('media/long_background.png'),
|
|
|
|
|
2018-03-05 17:38:12 +01:00
|
|
|
init: function() {
|
2018-03-12 08:37:16 +01:00
|
|
|
|
|
|
|
console.log('init called');
|
|
|
|
|
2018-03-05 17:38:12 +01:00
|
|
|
// initialize your game world, bind some
|
|
|
|
// keys, etc.
|
|
|
|
ig.input.bind( ig.KEY.SPACE, 'jump' );
|
|
|
|
|
2018-03-12 08:37:16 +01:00
|
|
|
|
2018-03-05 17:38:12 +01:00
|
|
|
this.loadLevel( LevelSnake );
|
|
|
|
},
|
|
|
|
|
|
|
|
draw : function() {
|
|
|
|
this.parent();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2018-03-12 08:22:29 +01:00
|
|
|
GameLib.Event.Subscribe(
|
|
|
|
GameLib.Event.GAME_START,
|
|
|
|
function(data) {
|
|
|
|
var size = GameLib.Utils.GetWindowSize();
|
2018-03-12 08:37:16 +01:00
|
|
|
ig.main('1cvwv04mfw', Snake, 60, 750, 1334, 1 );
|
2018-03-12 08:22:29 +01:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2018-03-12 08:22:44 +01:00
|
|
|
GameLib.Event.Emit(GameLib.Event.GAME_LOADED);
|
2018-03-05 17:38:12 +01:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
//@ sourceURL=entityLoaded.js
|