Skip to content

Commit

Permalink
Fix high jumps
Browse files Browse the repository at this point in the history
  • Loading branch information
alesan99 committed Oct 17, 2024
1 parent 3bb782d commit 5928383
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion website/game/menu/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ MENUS["chatMenu"] = new class extends Menu {
}
break
case "/jump":
PLAYER.jump(Number(arg2) || 0)
PLAYER.jump(Number(arg) || 0)
break
case "/debug": // Debug physics
setDebugPhysics(!DEBUGPHYSICS)
Expand Down
7 changes: 7 additions & 0 deletions website/game/objects/character.js
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,13 @@ export default class Character extends PhysicsObject {
if (this == PLAYER) {
NETPLAY.sendAction("jump", dist)
}

// High jumps should cause dust clouds
if (dist > 1000) {
PARTICLES.push(new Particle(this.x-20, this.y-4, IMG.particle, SPRITE.dust, [0,1], 0.1))
PARTICLES.push(new Particle(this.x, this.y, IMG.particle, SPRITE.dust, [0,1], 0.1))
PARTICLES.push(new Particle(this.x+20, this.y-4, IMG.particle, SPRITE.dust, [0,1], 0.1))
}
}

// Collision
Expand Down

0 comments on commit 5928383

Please sign in to comment.