Skip to content

Commit

Permalink
Can't exit level unless all coins are collected.
Browse files Browse the repository at this point in the history
  • Loading branch information
ripsawridge committed Nov 22, 2014
1 parent 1b3672f commit 260480f
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 8 deletions.
4 changes: 2 additions & 2 deletions melonjs-tutorial/boilerplate-master/data/map/area01.tmx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</imagelayer>
<layer name="background" width="40" height="15">
<data encoding="base64">
CAAAAAgAAAAAAAAAAAAAACkAAAAtAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAgAAAAIAAAABgAAACkAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAIAAAACAAAAAgAAAAIAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAIAAAACAAAAAgAAAAIAAAABgAAAAYAAAAZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAApAAAAGQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAABgAAAAgAAAAtAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAABgAAABkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAqAAAAKgAAACoAAAAqAAAAKgAAABYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAACkAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAAKQAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAA
</data>
</layer>
<objectgroup color="#9c18a4" name="Entities">
Expand Down Expand Up @@ -161,7 +161,7 @@
</layer>
<layer name="collision" width="40" height="15" opacity="0.5">
<data encoding="base64">
jQAAAI0AAAAAAAAAAAAAAI0AAACNAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACNAAAAjQAAAI0AAACNAAAAjQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI0AAACNAAAAjQAAAI0AAACNAAAAjQAAAI0AAACNAAAAAAAAAAAAAAAAAAAAAAAAAI0AAACNAAAAjQAAAI0AAACNAAAAjQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI0AAACNAAAAjQAAAI0AAACNAAAAjQAAAAAAAACNAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI0AAAAAAAAAjQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACNAAAAjQAAAI0AAACNAAAAjQAAAI0AAACNAAAAjQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACNAAAAjQAAAI0AAACNAAAAjQAAAI0AAACNAAAAjQAAAI0AAACNAAAAjQAAAI0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI0AAACNAAAAjQAAAI0AAACNAAAAjQAAAI0AAACNAAAAjQAAAI0AAACNAAAAjQAAAI0AAACNAAAAjQAAAI0AAACNAAAAjQAAAI0AAACNAAAAjQAAAI0AAACNAAAA
</data>
</layer>
</map>
15 changes: 10 additions & 5 deletions melonjs-tutorial/boilerplate-master/js/entities/HUD.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ game.HUD.Container = me.Container.extend({
// give a name
this.name = "HUD";

// add our child score object at the top left corner
this.addChild(new game.HUD.ScoreItem(430, 440));
// add our child score object at the lower right corner
this.addChild(new game.HUD.ScoreItem(230, 440));
}
});

Expand All @@ -51,6 +51,8 @@ game.HUD.ScoreItem = me.Renderable.extend({
// local copy of the lives
this.lives = -1;

this.coinsNotCollected = -1;

// make sure we use screen coordinates
this.floating = true;
},
Expand All @@ -62,9 +64,11 @@ game.HUD.ScoreItem = me.Renderable.extend({
// we don't do anything fancy here, so just
// return true if the score has been updated
if (this.score !== game.data.score ||
this.lives !== game.data.lives) {
this.lives !== game.data.lives ||
this.coinsNotCollected != game.data.coinsNotCollected) {
this.score = game.data.score;
this.lives = game.data.lives;
this.coinsNotCollected = game.data.coinsNotCollected;
return true;
}
return false;
Expand All @@ -74,8 +78,9 @@ game.HUD.ScoreItem = me.Renderable.extend({
* draw the score
*/
draw : function (context) {
this.font.draw(context, game.data.score, this.pos.x + 200, this.pos.y);
this.font.draw(context, game.data.lives, this.pos.x, this.pos.y);
this.font.draw(context, game.data.coinsNotCollected, this.pos.x, this.pos.y);
this.font.draw(context, game.data.score, this.pos.x + 400, this.pos.y);
this.font.draw(context, game.data.lives, this.pos.x + 200, this.pos.y);
}

});
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ game.PlayerEntity = me.Entity.extend({
this.die();
}
} else if (response.b.body.collisionType == me.collision.types.ACTION_OBJECT) {
// b is a LevelEntity. Indicate our new respawn point.
game.data.current_level = response.b.nextlevel;
}
},
Expand Down Expand Up @@ -106,6 +105,7 @@ game.CoinEntity = me.CollectableEntity.extend({

onCollision: function() {
game.data.score += 3;
game.data.coinsNotCollected--;

me.audio.play("cling");

Expand Down
31 changes: 31 additions & 0 deletions melonjs-tutorial/boilerplate-master/js/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ var game = {
score : 0,
// number of lives
lives : 3,
// This is programmatically determined on level loads.
coinsNotCollected : 0,
// current level
current_level: "area03",
// reset function
"reset" : function() {
this.score = 0;
this.lives = 3;
this.current_level = "area01";
this.coinsNotCollected = 0;
}
},

Expand All @@ -40,6 +43,14 @@ var game = {
// Set a callback to run when loading is complete.
me.loader.onload = this.loaded.bind(this);

// Set a callback for level loads too.
me.game.onLevelLoaded = this.levelLoaded.bind(this);

// We need to prevent level collisions if you don't have enough
// coins.
this.oldShouldCollide = me.collision.shouldCollide;
me.collision.shouldCollide = this.shouldCollide.bind(this);

// Load the resources.
me.loader.preload(game.resources);

Expand All @@ -65,5 +76,25 @@ var game = {

// Start the game.
me.state.change(me.state.MENU);
},

"levelLoaded" : function(levelName) {
// Discover the number of coins that need to be collected to successfully
// exit the level.
var coins = me.game.world.getChildByName("CoinEntity");
game.data.coinsNotCollected = coins.length;
},

"shouldCollide" : function(a, b) {
var answer = this.oldShouldCollide(a, b);
if (answer === true) {
// Do additional checks
if (a.name === "mainplayer" && b.name == "me.levelentity") {
if (game.data.coinsNotCollected > 0) {
return false;
}
}
}
return answer;
}
};

0 comments on commit 260480f

Please sign in to comment.