src/js/events.js
// misc handlers to save dupe code
misc handlers to save dupe code
misc handlers to save dupe code
function handleDisplace (entity, collision) {
  entity.x += collision.normal.x * collision.depth
  entity.y += collision.normal.y * collision.depth
  entity.velocity.x = 0
  entity.velocity.y = 0
}
function handleDisplace ( entity , collision ) { entity . x += collision . normal . x * collision . depth entity . y += collision . normal . y * collision . depth entity . velocity . x = 0 entity . velocity . y = 0 }
misc handlers to save dupe code
misc handlers to save dupe code