2018-02-27 12:43:58 +01:00
|
|
|
if (this.parentEntity === data.entity) {
|
|
|
|
console.log('Entity Impact Test Loaded');
|
|
|
|
} else {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-02-27 13:41:53 +01:00
|
|
|
ig.module(
|
|
|
|
'game.impact-test'
|
|
|
|
)
|
|
|
|
.requires(
|
2018-02-27 13:53:16 +01:00
|
|
|
'impact.font',
|
2018-02-27 13:41:53 +01:00
|
|
|
'impact.game',
|
2018-03-02 13:45:54 +01:00
|
|
|
'impact.image',
|
|
|
|
'game.levels.snake'
|
2018-02-27 13:41:53 +01:00
|
|
|
)
|
|
|
|
.defines(function(){
|
|
|
|
|
|
|
|
// code for this module
|
|
|
|
|
|
|
|
// Create your own game class
|
2018-03-02 10:27:32 +01:00
|
|
|
ig.global.Snake = ig.Game.extend(
|
2018-02-27 13:52:22 +01:00
|
|
|
|
|
|
|
{
|
|
|
|
font: new ig.Font( 'media/04b03.font.png' ),
|
|
|
|
|
|
|
|
init: function() {
|
|
|
|
// initialize your game world, bind some
|
|
|
|
// keys, etc.
|
|
|
|
ig.input.bind( ig.KEY.SPACE, 'jump' );
|
2018-02-27 13:41:53 +01:00
|
|
|
|
2018-02-27 13:52:22 +01:00
|
|
|
console.log('init called');
|
2018-03-02 13:47:51 +01:00
|
|
|
this.loadLevel( LevelSnake );
|
2018-02-27 13:52:22 +01:00
|
|
|
}
|
2018-02-27 13:41:53 +01:00
|
|
|
}
|
2018-02-27 13:52:22 +01:00
|
|
|
);
|
2018-02-27 13:41:53 +01:00
|
|
|
|
2018-03-02 10:34:27 +01:00
|
|
|
var size = GameLib.Utils.GetWindowSize();
|
|
|
|
|
2018-02-27 13:41:53 +01:00
|
|
|
// Start your game
|
|
|
|
// 60fps, 320x240 pixels, scaled up by a factor of 2
|
2018-03-02 13:48:49 +01:00
|
|
|
ig.main('#n5iza1dcbp', Snake, 60, size.width, size.height, 0.5 );
|
2018-02-27 13:41:53 +01:00
|
|
|
|
2018-02-27 12:38:15 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
|
2018-02-27 12:35:17 +01:00
|
|
|
//@ sourceURL=entityLoaded.js
|