fix CCD (but introduce another issue >.<)

This commit is contained in:
Schluffe
2026-04-19 16:24:40 +02:00
parent 52e4aca941
commit 7a068060e1
2 changed files with 28 additions and 23 deletions
+3 -3
View File
@@ -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;