Skip to content

Commit

Permalink
Merge branch 'nighthawkcoders:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Trystan-Schmits authored Feb 16, 2024
2 parents 4145ea0 + 27c3fa5 commit 9ba58e3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
Binary file added assets/audio/coin.mp3
Binary file not shown.
2 changes: 1 addition & 1 deletion assets/js/platformer2/Audio4.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ function coinSound() {


//Export Sound
export default coinSound
export default coinSound
2 changes: 0 additions & 2 deletions assets/js/platformer2/Coin.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export class Coin extends GameObject {

// Center and set Coin position with adjustable height and width
size() {
// Make the image 10 times smaller
const scaledWidth = this.image.width * 0.2;
const scaledHeight = this.image.height * 0.169;

Expand All @@ -51,7 +50,6 @@ export class Coin extends GameObject {
this.canvas.style.left = `${coinX}px`;
this.canvas.style.top = `${coinY}px`;
}

collisionAction() {
// check player collision
if (this.collisionData.touchPoints.other.id === "player") {
Expand Down
10 changes: 5 additions & 5 deletions assets/js/platformer2/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ export class Player extends Character {
* @override
*/
collisionAction() {
// Tube collision check
if (this.collisionData.touchPoints.other.id === "tube") {
// Collision with the left side of the Tube
if (this.collisionData.touchPoints.other.left) {
Expand Down Expand Up @@ -258,6 +259,7 @@ export class Player extends Character {
this.movement.right = true;
}

// Tree collision check
if (this.collisionData.touchPoints.other.id === "tree") {
// Collision with the left side of the tree
if (this.collisionData.touchPoints.other.left) {
Expand Down Expand Up @@ -285,6 +287,7 @@ export class Player extends Character {
this.movement.right = true;
}

// Goomba collision check
// Checks if collision touchpoint id is either "goomba" or "flyingGoomba"
if (this.collisionData.touchPoints.other.id === "goomba" || this.collisionData.touchPoints.other.id === "flyingGoomba") {
if (GameEnv.invincible === false) {
Expand Down Expand Up @@ -334,17 +337,14 @@ export class Player extends Character {
this.movement.down = false; // enable movement down without gravity
this.gravityEnabled = false;
this.setAnimation(this.directionKey); // set animation to direction
}}

}
}
// Fall Off edge of Jump platform
else if (this.movement.down === false) {
this.movement.down = true;
this.gravityEnabled = true;
}
}




/**
* Handles the keydown event.
Expand Down
10 changes: 5 additions & 5 deletions navigation/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,30 @@ permalink: /about/
<tbody>
<tr>
<td><a href="https://ryann96.github.io/NewRepository2/">Ryan</a></td>
<td>Gabriel</td>
<td><a href="https://gabriel-gravin.github.io/Gabbb/">Gabriel</a></td>
<td>Daniel</td>
<td><a href = "https://maryamabdul-aziz.github.io/student2/">Maryam</a></td>
<td><a style="background-image: linear-gradient(to right, red,orange,yellow,green,blue,indigo,violet); -webkit-background-clip: text; -webkit-text-fill-color: transparent;" href = "https://trystan-schmits.github.io/game_levels_mp/index">Trystan</a></td>
</tr>
<tr>
<td><a href="https://gavincopley.github.io/testing/">Gavin C</a></td>
<td>Nora</td>
<td><a href="https://noratheturtle.github.io/code/">Nora</a></td>
<td>Xavier</td>
<td>Daisy</td>
<td><a href="https://matthewborabo.github.io/student2.0/">Matthew</a></td>
</tr>
<tr>
<td>Nathan</td>
<td>Katie</td>
<td><a href="https://katiek27.github.io/finaltwo/">Katie</a></td>
<td>Justin</td>
<td>Zidane</td>
<td>Ian</td>
</tr>
<tr>
<td><a href="https://deanphillips24.github.io/csse2_individual/">Dean</a></td>
<td>Kaden</td>
<td><a href="https://whoskaden.github.io/Kaddd/">Kaden</a></td>
<td>Abigail</td>
<td><a href="https://zafeera123.github.io/Personal2/">Zafeer</
<td><a href="https://zafeera123.github.io/Personal2/">Zafeer</a></td>
<td>Gavin I</td>
</tr>
<tr>
Expand Down

0 comments on commit 9ba58e3

Please sign in to comment.