fix CCD (but introduce another issue >.<)
This commit is contained in:
@@ -72,7 +72,7 @@ const process = defineEntity<{
|
||||
stuff: 1,
|
||||
});
|
||||
|
||||
process((id, _delta) => {
|
||||
process((id, delta) => {
|
||||
const position = $<Vector>("position").get(id)!.value;
|
||||
const velocity = $<Vector>("velocity").get(id)!.value;
|
||||
const collider = $<Collider>("collider").get(id)!.value;
|
||||
@@ -80,8 +80,8 @@ process((id, _delta) => {
|
||||
const sprite = $<Sprite>("sprite").get(id)!;
|
||||
const animation = $<SpriteAnimation>("animation").get(id)!;
|
||||
|
||||
velocity.x = stuff.value * 0.5;
|
||||
position.x += velocity.x;
|
||||
velocity.x = stuff.value * 0.05;
|
||||
position.x += velocity.x * delta;
|
||||
|
||||
if (position.x + collider.offset.x > viewport.canvas.width - 16) {
|
||||
stuff.value = -1;
|
||||
|
||||
Reference in New Issue
Block a user