Physics stage 1b: six new nodes act on dynamic bodies in play (Apply force over the frame, independent of the frame rate, Apply impulse, Set velocity, Set angular velocity, Get velocity, Set gravity for the rest of the run), a node on an object without a dynamic body and moving a dynamic body directly each log a hint once per object, and Move with collision now pushes dynamic bodies with a mass-dependent push while the mover stays flush; Move keeps its own move-and-slide instead of Rapier's character controller, which measurably snags on seams between colliders (#147)
game-maker / gate (push) Successful in 1m46s
game-maker / suite (push) Failing after 5m35s

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 5 committed 2026-09-18 19:19:21 +02:00
1 parent 78899b1ace
commit 0ff3c8b742
10 files changed
+783 -43

No files matched your search

+17
View File
@@ -82,6 +82,21 @@ export interface SharedState {
states: Record<string, string>;
}
/**
* What a graph can do to the played game's physics (#147). The object is the one a rigidbody sits
* on, or the rigidbody itself; only a dynamic body is acted on or read, and each call answers
* whether there was one. Vectors are world units, turning is degrees the way rotation counts.
*/
export interface PhysicsControl {
velocityOf(target: EntityHandle): { x: number; y: number; angular: number } | null;
setVelocity(target: EntityHandle, x: number, y: number): boolean;
setAngularVelocity(target: EntityHandle, degrees: number): boolean;
/** World units × kg per second: the velocity changes by impulse ÷ mass. */
applyImpulse(target: EntityHandle, x: number, y: number): boolean;
/** World units per second squared, for the rest of the run. */
setGravity(x: number, y: number): void;
}
/**
* Everything the graph does to the world goes through here, so the core stays free of runtime
* imports. Implemented by the runtime (BehaviorSystem) and by test doubles.
@@ -121,6 +136,8 @@ export interface NodeContext {
* axis (x first, then y) so it slides along walls.
*/
moveAndSlide(target: EntityHandle, dx: number, dy: number): { blockedX: boolean; blockedY: boolean };
/** Absent where nothing is simulated: the editor run, and a test double that does not ask for it. */
physics?: PhysicsControl;
log(message: string): void;
/**
* Starts a sound asset, named by its id. `volume` multiplies the asset's own (1 leaves it alone);