planet-wars/frontend/www/index.ts

16 lines
403 B
TypeScript
Raw Normal View History

2019-09-17 14:03:16 +02:00
import { Game } from "planetwars";
2019-09-17 18:27:44 +02:00
import { memory } from "planetwars/plantwars_bg";
const CANVAS = <HTMLCanvasElement>document.getElementById("c");
function create_array(ptr: number, size: number): Float64Array {
return new Float64Array(memory.buffer, ptr, size);
}
2019-09-17 14:03:16 +02:00
export function main(game: Game) {
console.log(game.turn_count());
2019-09-17 18:27:44 +02:00
console.log(create_array(game.get_viewbox(), 4));
2019-09-17 14:03:16 +02:00
}