60b6af8e63
If the AI or the human player looses 10 games, the game is over and goes back into the main screen. A score is displayed on top of the game for each side.
25 lines
422 B
JavaScript
25 lines
422 B
JavaScript
ig.module(
|
|
'game.entities.goal'
|
|
)
|
|
.requires(
|
|
'impact.entity'
|
|
)
|
|
.defines(function(){
|
|
EntityGoal = ig.Entity.extend({
|
|
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.game.score[this.owner] -= 1;
|
|
other.reset();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|