uberpong/dev/lib/game/entities/goal.js
2013-04-11 21:49:31 +02:00

28 lines
512 B
JavaScript

ig.module(
'game.entities.goal'
)
.requires(
'impact.entity'
)
.defines(function(){
EntityGoal = ig.Entity.extend({
looseSound: new ig.Sound('media/sounds/loose.ogg'),
height: 90,
size: {x:48, y:48},
checkAgainst: ig.Entity.TYPE.B,
_wmScalable: true,
_wmDrawBox: true,
_wmBoxColor: '#00ff00',
check: function(other) {
if (other.name == 'ball') {
ig.global.score[this.owner] -= 1;
other.reset();
this.looseSound.play();
}
}
});
});