This is the code after the Cup and Dice were classified and generated. The code works perfectly at this stage.
// This is the code for my first zombie game
// This is the code for the Dice class of objects
class Dice {
// constructor method will create new Dice objects
constructor(colour,faces) {
this.colour = colour;
this.faces = faces;
}
rollDie() {
// generate a random number between 1 and 6
var randomNumber = Math.floor((Math.random() * 6) + 1);
// pick a face using the random number we generated
var face = this.faces[randomNumber - 1];
return face;
}
// helper method for getting face value
face() {
var face = this.rollDie();
return face;
}
}
class Cup {
//constructor method to create a new cup
constructor(r,y,g) {
this.red = r;
this.yellow = y;
this.green = g;
this.dice = new Array();
}
// create methods to generate new dice
newRedDie() {
var newDie = new Dice("red",["shotgun","shotgun","shotgun","feet","feet","brains"]);
return newDie;
}
newYellowDie() {
var newDie = new Dice ("yellow",["shotgun","shotgun","feet","feet","brains","brains"]);
return newDie;
}
newGreenDie() {
var newDie = new Dice ("green",["shotgun",,"feet","feet","brains","brains","brains"]);
return newDie;
}
setupCup() {
// loop through the value of this.red to make all the red dice
for (var i = 0; i < this.red; i++) {
var newRedDie = this.newRedDie();
this.dice.push(newRedDie);
}
for (var i = 0; i < this.yellow; i++) {
var newYellowDie = this.newYellowDie();
this.dice.push(newYellowDie);
}
for (var i = 0; i < this.green; i++) {
var newGreenDie = this.newGreenDie();
this.dice.push(newGreenDie);
}
}
}
// This is where code will run
var myCup = new Cup(3,4,6);
myCup.setupCup();
document.write(myCup.dice[0].colour);
Thursday, 24 November 2016
Thursday, 17 November 2016
Wednesday, 2 November 2016
8 Twine Games
- Queers in Love at the End of the World
Feelings: - Feel very pressured when playing the game
- Too fast
Best Aspect: - Very Forward
Worst Aspect: - 10 second timer
- The Uncle Who Works for Nintendo
Feelings: - Very intrigued and curious
- Amazingly unique experience
- Brilliant sense of emotion
Best Aspect: - Multiple endings adds for amazing replay value
Worst Aspect: - Quite similar to many creepypasta ROM-Hacks
- Luigi's Mansion 64 (ROM-Hack) in particular
- With those we love alive
Feelings: - Tense
- Very poetic and well-written
Best Aspect: - Excellent writing
Worst Aspect: - Hard to progress
- Cat Petting Simulator 2014
Feelings: - Funny
- Calming
Best Aspect: - Unique
Worst Aspect: - Creepily Realistic
- Depression Quest
Feelings: - Depressing
- Very real
Best Aspect: - Complete realism and very heavily enforced
Worst Aspect: - Very long
- CRY$TAL WARRIOR KE$HA
Feelings: - Funny
- Unconvential
- Similar to Brutal Legend and many basic fantasy archetypes
Best Aspect: - Completely unique and well-written
Worst Aspect: - Very short
- daymere #1: ritual
Feelings: - Very real
- Dark
- Inspired
Best Aspect: - Well written
Worst Aspect: - Quite short and fairly bad UI
- Domovoi
Feelings: - Inspired
Best Aspect: - Very well written
Worst Aspect: - Not interactive enough
Subscribe to:
Posts (Atom)