[oden] Time, path searching, game directory
This commit is contained in:
parent
96e95e22ce
commit
26bfcc7a94
8 changed files with 185 additions and 13 deletions
BIN
game/happy-tree.png
Normal file
BIN
game/happy-tree.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
26
game/main.ts
Normal file
26
game/main.ts
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { cls, print, spr, use_texture } from "./graphics";
|
||||
import { load_texture } from "./assets";
|
||||
import { since_start, since_last_frame } from "./time";
|
||||
|
||||
let the_texture: number | undefined = undefined;
|
||||
|
||||
export function init() {
|
||||
print("Hello world!");
|
||||
|
||||
// Start this load, but then...
|
||||
load_texture("./happy-tree.png").then((n) => {
|
||||
print("Tree loaded at", since_start());
|
||||
the_texture = n;
|
||||
});
|
||||
}
|
||||
|
||||
export function update() {}
|
||||
|
||||
export function draw() {
|
||||
cls(0.1, 0.2, 0.3);
|
||||
if (the_texture != undefined) {
|
||||
// ...it gets resolved here?
|
||||
use_texture(the_texture);
|
||||
spr((320 - 256) / 2, 0, 256, 240, 0, 0);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue