Skip to content

Commit

Permalink
Name fn better
Browse files Browse the repository at this point in the history
  • Loading branch information
surrsurus committed Jun 4, 2024
1 parent a8cfa7b commit 9e541ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions assets/js/gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ function animate() {
if (keys.space && me.drawable.position.y == 0) jump(me);

// Testing: Check collision
if (player_registry.checkCollision()) {
move(me, -speed - 0.01);
}
if (player_registry.currentlyColliding()) move(me, -speed - 0.01);

// Send updates if we are getting updates from the player, but not if we're animating
// (animations send their own updates)
Expand Down
2 changes: 1 addition & 1 deletion assets/js/objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class PlayerRegistry {
}
}

checkCollision() {
currentlyColliding() {
const all_players_but_me = Object.values(this.players).map((player) => player.drawable);

for (let vertexIndex = 0; vertexIndex < this.me.drawable.geometry.attributes.position.array.length; vertexIndex += 3) {
Expand Down

0 comments on commit 9e541ec

Please sign in to comment.