18 lines
405 B
TypeScript
18 lines
405 B
TypeScript
import { cls, print, spr, use_texture } from "./graphics.ts";
|
|
import { load_texture } from "./assets.ts";
|
|
|
|
let the_texture = 0;
|
|
|
|
export function init() {
|
|
print("Hello world!");
|
|
// TODO: Async IO
|
|
the_texture = load_texture("./src/happy-tree.png");
|
|
}
|
|
|
|
export function update() {}
|
|
|
|
export function draw() {
|
|
cls(0.1, 0.2, 0.3);
|
|
use_texture(the_texture);
|
|
spr((320 - 256) / 2, 0, 256, 240, 0, 0);
|
|
}
|