46 lines
841 B
JavaScript
46 lines
841 B
JavaScript
|
if (this.parentEntity === data.entity) {
|
||
|
console.log('Entity Impact Test Loaded');
|
||
|
} else {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
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' ),
|
||
|
|
||
|
init: function() {
|
||
|
// initialize your game world, bind some
|
||
|
// keys, etc.
|
||
|
ig.input.bind( ig.KEY.SPACE, 'jump' );
|
||
|
|
||
|
console.log('init called');
|
||
|
this.loadLevel( LevelSnake );
|
||
|
}
|
||
|
}
|
||
|
);
|
||
|
|
||
|
var size = GameLib.Utils.GetWindowSize();
|
||
|
|
||
|
// Start your game
|
||
|
// 60fps, 320x240 pixels, scaled up by a factor of 2
|
||
|
ig.main('#7ckj7lg8ti', Snake, 60, 64 * 20, 64 * 20, 1 );
|
||
|
|
||
|
});
|
||
|
|
||
|
|
||
|
//@ sourceURL=entityLoaded.js
|