Jester stomp sounds, not step !
This commit is contained in:
@@ -303,6 +303,20 @@ Deno.test("a clip plays from when its state started, and with walking as strongl
|
||||
assertAlmostEquals(animation.pose(15)!.get("arm")!.rotation[0], 22.5);
|
||||
});
|
||||
|
||||
Deno.test("an animator's step_sound picks each step's sound, and one without it keeps the entity's own", () => {
|
||||
const { type } = animator_type("stomper", (entity) => ({
|
||||
pose() {},
|
||||
step_sound: () => entity.get_client_data<boolean>("angry") ? "test:stomp" : undefined,
|
||||
}));
|
||||
const entity = animated(type);
|
||||
const animation = animation_for(entity)!;
|
||||
assertEquals(animation.step_sound("test:own"), undefined);
|
||||
entity.data = { client_data: { angry: true } };
|
||||
assertEquals(animation.step_sound("test:own"), "test:stomp");
|
||||
const { type: quiet } = animator_type("quiet", () => ({ pose() {} }));
|
||||
assertEquals(animation_for(animated(quiet))!.step_sound("test:own"), "test:own");
|
||||
});
|
||||
|
||||
Deno.test("an animator that throws is removed, and the entity is posed without it", async () => {
|
||||
const { type } = animator_type("thrower", () => ({
|
||||
pose(pose) {
|
||||
|
||||
Reference in New Issue
Block a user