[game] Bot sprite

This commit is contained in:
John Doty 2023-07-02 10:55:03 -07:00
parent 829bd872fd
commit f9b41dd729
3 changed files with 7 additions and 7 deletions

BIN
game/bot.aseprite Normal file

Binary file not shown.

BIN
game/bot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

View file

@ -2,15 +2,15 @@ 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;
let bot_sprite: 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;
load_texture("./bot.png").then((n) => {
print("Bot loaded at", since_start());
bot_sprite = n;
});
}
@ -18,10 +18,10 @@ export function update() {}
export function draw() {
cls(0.1, 0.2, 0.3);
if (the_texture != undefined) {
if (bot_sprite != undefined) {
// ...it gets resolved here?
use_texture(the_texture);
spr((320 - 256) / 2, 0, 256, 240, 0, 0);
use_texture(bot_sprite);
spr(10, 10, 32, 32, 0, 0);
}
// print("FRAME TIME:", since_last_frame());
}