landgreen / n-gon

2-d physics rogue-lite platformer shooter
https://landgreen.github.io/n-gon/
GNU General Public License v3.0
134 stars 193 forks source link

Random unused momentum? #188

Closed kgurchiek closed 3 months ago

kgurchiek commented 3 months ago

While working on multiplayer I noticed there are several times in harpoon's code where a "momentum" variable is created, but I couldn't find anywhere it's used. Is this a remnant of something scrapped or am I just missing something?

example: bullet.js line 1516: const momentum = Vector.mult(Vector.sub(this.velocity, player.velocity), (m.crouch ? 0.0001 : 0.0002))

landgreen commented 3 months ago

looks to me like it's used in the next two lines const momentum = Vector.mult(Vector.sub(this.velocity, player.velocity), (m.crouch ? 0.0001 : 0.0002)) player.force.x += momentum.x player.force.y += momentum.y

kgurchiek commented 3 months ago

oh I'm stupid, I forgot that I deleted that part for the client-side code🤦‍♂️. Thanks for the help