David Leonard
February 26, 2015
About Me
What is ImpactJS?
Why ImpactJS?
JavaScript Objects
var person = {
name: David,
age: 23,
major: Computer Science
};
person.name; // David
person.age; // 23
person.major; // Computer Science
//Augment the person object
person['lastName'] = Leonard
ig.module(
'game.main'
)
.requires(
'impact.game',
'impact.debug.debug',
'game.levels.basic'
)
.defines(function(){
MyGame = ig.Game.extend({
// Define some functions here
});
ig.main('#canvas', MyGame, 60, 320, 240, 2);
});
draw: function(){
this.parent();
if(this.font){
var player = ig.game.getEntitiesByType('EntityPlayer')[0];
this.font.draw('Health: ' + player.health, 50, 10, ig.Font.ALIGN.CENTER);
}
}
init: function(){
ig.input.bind(ig.KEY.LEFT_ARROW, 'left');
ig.input.bind(ig.KEY.RIGHT_ARROW, 'right');
ig.input.bind(ig.KEY.X, 'jump');
this.loadLevel(LevelBasic);
},
LIVE DEMONSTRATION
General Advice
Follow me on Github: https://github.com/DrkSephy
Personal website: http://drksephy.github.io/
Tutorial: http://drksephy.github.io/2014/08/27/impactjs/
Super Mario World - Koopa Krisis: http://drksephy.bitbucket.org/
Fire Emblem - Chronicles of the Abyss: http://chessmasterhong.bitbucket.org/projects/WaterEmblem/
QUESTIONS?
Lightning Blade
_________________________________________
TP: 10
Pierce and shock the target with lightning.