Skip to content

Commit

Permalink
start of credits added
Browse files Browse the repository at this point in the history
  • Loading branch information
baconeta committed Oct 4, 2021
1 parent 630d626 commit a29086d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/level_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Crafty.c("LevelController", {
if (this.canChangeLevel()) {
this.startLoading();
setTimeout(this.loadNextLevel, 500);
} else { // no more levels so go to end screen
} else if (this.level >= this.totalLevels) { // no more levels so go to end screen
Crafty.enterScene("EndScreen", Crafty.enterScene("EndScreen")) // there was a bug... this was my fix :)
}
});
Expand Down
16 changes: 16 additions & 0 deletions components/title.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,19 @@ Crafty.c("StoneIcon", {
// this.image("assets/images/stone_green.png");
}
});
var credits = ["Game Producer and Developer - Josh Pearson", "Senior Developer - Steven Rutherford", "Environment and Asset Artist - Veera Villgren",
"Game Developer - James Coburn", "Game Developer and Level Design - Brayden Cooke", "Character and Asset Artist - Santeri Kivioja",
"Senior Developer - Nick Farrelly", "Senior Developer - Tomas Morton", "Sound Effects and Music Engineer - Jakob Ericsson", "Game Design and Graphic Art - Samai Azeez"]
Crafty.c("Credits", {
init: function () {
this.addComponent('2D, DOM, Text');
this.attr({x: 350, y: 320, w: 400, h: 300});
for (let person in credits) {
this.text(person)
.textFont({size: '15px'})
.textAlign("left")
.textColor("white")
this.x+=18;
}
}
});
5 changes: 4 additions & 1 deletion scenes/endscreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ Crafty.defineScene('EndScreen', function () {
// });
var creditsButton = Crafty.e("CreditsButton")
.bind('Click', function (MouseEvent) {
//Add credits here
// Crafty.e("Text").attr({x: 350, y: 320, w: 100, h: 18}).text("Me")
// .textFont({size: '15px'})
// .textAlign("left")
// .textColor("white");
});
var stoneIcon = Crafty.e("StoneIcon");
var muteIcon = Crafty.e("Music");
Expand Down
6 changes: 4 additions & 2 deletions scenes/title_screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ Crafty.defineScene('Title', function () {
});
var creditsButton = Crafty.e("CreditsButton")
.bind('Click', function (MouseEvent) {
// User has interact with DOM, so we can now autoplay sound
console.log("credits hehe")
// Crafty.e("2D, DOM, Text").attr({x: 350, y: 320, w: 100, h: 18}).text("")
// .textFont({size: '15px'})
// .textAlign("left")
// .textColor("white");
});
var stoneIcon = Crafty.e("StoneIcon");
var muteIcon = Crafty.e("Music");
Expand Down

0 comments on commit a29086d

Please sign in to comment.