Skip to content

Commit

Permalink
Fix several typos.
Browse files Browse the repository at this point in the history
  • Loading branch information
Prometheos2 committed Apr 13, 2019
1 parent c68399f commit 0c927ff
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion WHG - level2/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Player{
move(){
if (!humanPlaying){
if (this.moveCount == 0) {//move in the direction for 6 frames
if (this.brain.directions.length > this.brain.step) {//if there are still directions left then set the velocity as the next PVector in the direcitons array
if (this.brain.directions.length > this.brain.step) {//if there are still directions left then set the velocity as the next PVector in the direction array
this.vel = this.brain.directions[this.brain.step];
this.brain.step++;
} else {//if at the end of the directions array then the player is dead
Expand Down
8 changes: 4 additions & 4 deletions WHG - level2/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function setup() {
winArea = new Solid(tiles[17][2], tiles[19][7]);
testPopulation = new Population(populationSize);
img = loadImage("assets/DAB.png");
//prevents the window from moving from the arrow keys or the spacebar
//prevents the window from moving from the arrow keys or the space bar
window.addEventListener("keydown", function(e) {
// space and arrow keys
if([32, 37, 38, 39, 40].indexOf(e.keyCode) > -1) {
Expand Down Expand Up @@ -154,7 +154,7 @@ function draw(){
genPlayer.update();
genPlayer.show();
}
} else//if training normaly
} else//if training normally
if (testPopulation.allPlayersDead()) {
//genetic algorithm
testPopulation.calculateFitness();
Expand All @@ -163,7 +163,7 @@ function draw(){
//reset dots
resetDots();

//every 5 generations incease the number of moves by 5
//every 5 generations increase the number of moves by 5
if (testPopulation.gen % increaseEvery ==0) {
testPopulation.increaseMoves();
}
Expand Down Expand Up @@ -521,7 +521,7 @@ function plusEvery(){
}

//--------------------------------------------------------------------------------------------------------------------------------
//this just prints the coordinates of the tile which is clicked, usefull for level building
//this just prints the coordinates of the tile which is clicked, useful for level building
// function mousePressed() {

// var x = floor((mouseX - xoff )/tileSize);
Expand Down
2 changes: 1 addition & 1 deletion WHG - level3/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Player{
move(){
if (!humanPlaying){
if (this.moveCount == 0) {//move in the direction for 6 frames
if (this.brain.directions.length > this.brain.step) {//if there are still directions left then set the velocity as the next PVector in the direcitons array
if (this.brain.directions.length > this.brain.step) {//if there are still directions left then set the velocity as the next PVector in the direction array
this.vel = this.brain.directions[this.brain.step];
this.brain.step++;
} else {//if at the end of the directions array then the player is dead
Expand Down
10 changes: 5 additions & 5 deletions WHG - level3/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function setup() {
}
}

setLevel1Walls();
setLevel1Walls();
setLevel2Goal();
setLevel1SafeArea();
setEdges();
Expand All @@ -93,7 +93,7 @@ function setup() {
winArea = new Solid(tiles[10][4], tiles[11][5]);
testPopulation = new Population(populationSize);
img = loadImage("assets/DAB.png");
//prevents the window from moving from the arrow keys or the spacebar
//prevents the window from moving from the arrow keys or the space bar
window.addEventListener("keydown", function(e) {
// space and arrow keys
if([32, 37, 38, 39, 40].indexOf(e.keyCode) > -1) {
Expand Down Expand Up @@ -154,7 +154,7 @@ function draw(){
genPlayer.update();
genPlayer.show();
}
} else//if training normaly
} else//if training normally
if (testPopulation.allPlayersDead()) {
//genetic algorithm
testPopulation.calculateFitness();
Expand All @@ -163,7 +163,7 @@ function draw(){
//reset dots
resetDots();

//every 5 generations incease the number of moves by 5
//every 5 generations increase the number of moves by 5
if (testPopulation.gen % increaseEvery ==0) {
testPopulation.increaseMoves();
}
Expand Down Expand Up @@ -521,7 +521,7 @@ function plusEvery(){
}

//--------------------------------------------------------------------------------------------------------------------------------
//this just prints the coordinates of the tile which is clicked, usefull for level building
//this just prints the coordinates of the tile which is clicked, useful for level building
function mousePressed() {

let x = floor((mouseX - xoff )/tileSize);
Expand Down
2 changes: 1 addition & 1 deletion WHG/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Player{
move(){
if (!humanPlaying){
if (this.moveCount == 0) {//move in the direction for 6 frames
if (this.brain.directions.length > this.brain.step) {//if there are still directions left then set the velocity as the next PVector in the direcitons array
if (this.brain.directions.length > this.brain.step) {//if there are still directions left then set the velocity as the next PVector in the direction array
this.vel = this.brain.directions[this.brain.step];
this.brain.step++;
} else {//if at the end of the directions array then the player is dead
Expand Down
8 changes: 4 additions & 4 deletions WHG/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ function setup() {
winArea = new Solid(tiles[17][2], tiles[19][7]);
testPopulation = new Population(populationSize);
img = loadImage("assets/DAB.png");
//prevents the window from moving from the arrow keys or the spacebar

//prevents the window from moving from the arrow keys or the space bar
window.addEventListener("keydown", function(e) {
// space and arrow keys
if([32, 37, 38, 39, 40].indexOf(e.keyCode) > -1) {
Expand Down Expand Up @@ -150,7 +150,7 @@ function draw(){
genPlayer.update();
genPlayer.show();
}
} else//if training normaly
} else//if training normally
if (testPopulation.allPlayersDead()) {
//genetic algorithm
testPopulation.calculateFitness();
Expand All @@ -159,7 +159,7 @@ function draw(){
//reset dots
resetDots();

//every 5 generations incease the number of moves by 5
//every 5 generations increase the number of moves by 5
if (testPopulation.gen % increaseEvery ==0) {
testPopulation.increaseMoves();
}
Expand Down

0 comments on commit 0c927ff

Please sign in to comment.