Fix some migration issues
This commit is contained in:
parent
da1bbb839d
commit
410c3cf504
|
|
@ -1,7 +0,0 @@
|
|||
export function awoo(a: i32, b: i32): void {
|
||||
console.log((a * b).toString());
|
||||
}
|
||||
|
||||
export function testTemplate(a: i32, f: f64): string {
|
||||
return `${a} + ${f} = ${a + f}`;
|
||||
}
|
||||
|
|
@ -1,10 +1,7 @@
|
|||
import { awoo, testTemplate } from "./awoo.wasm";
|
||||
import { render } from "preact";
|
||||
import attack from './assets/attack.wav';
|
||||
|
||||
export default function main() {
|
||||
awoo(42, 69);
|
||||
console.log(testTemplate(420, 69));
|
||||
|
||||
render(
|
||||
<button onClick={() => attack.play()}>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { delay, nextFrame } from "@common/utils";
|
||||
import { nextFrame } from "@common/utils";
|
||||
import { Color, GAME_HEIGHT, GAME_WIDTH } from "./const";
|
||||
import type { IChar, IColorLike, IRegion } from "./types";
|
||||
import { generateColors, randChar } from "./utils";
|
||||
|
|
@ -222,7 +222,7 @@ export async function tick(desiredFPS = 60) {
|
|||
const totalDelay = 1000 / desiredFPS;
|
||||
const remainingDelay = totalDelay - dt;
|
||||
if (remainingDelay > 4) {
|
||||
await delay(remainingDelay);
|
||||
await Bun.sleep(remainingDelay);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue