send help
This commit is contained in:
@@ -87,3 +87,5 @@ export function isBelowAbs(vector: Vector, abs: number): boolean {
|
||||
export function equals(a: Vector, b: Vector): boolean {
|
||||
return a.x === b.x && a.y === b.y;
|
||||
}
|
||||
|
||||
export const ZERO = createVector();
|
||||
|
||||
@@ -20,6 +20,8 @@ const CIRCLE = Shape.Circle;
|
||||
const RECT = Shape.Rect;
|
||||
const POLYGON = Shape.Polygon;
|
||||
|
||||
const EPSILON = 0.0001;
|
||||
|
||||
type CollisionBuffer = {
|
||||
size: number;
|
||||
mask: number;
|
||||
@@ -528,7 +530,7 @@ export function moveAndSlide(
|
||||
break;
|
||||
}
|
||||
|
||||
const scalar = Math.max(0, time - 0.001) * delta * timeLeft;
|
||||
const scalar = Math.max(0, time - EPSILON) * delta * timeLeft;
|
||||
position.x += velocity.x * scalar;
|
||||
position.y += velocity.y * scalar;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user