soldier test
This commit is contained in:
BIN
assets/sprites/soldier/spritesheet.png
Normal file
BIN
assets/sprites/soldier/spritesheet.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
@@ -35,9 +35,9 @@ export class NPC {
|
||||
if(this.options.scale == null) this.options.scale = 1;
|
||||
this.sprite = new SpriteSheet(ctx, spriteSheetPath, spriteDefPath);
|
||||
|
||||
setInterval(() => {
|
||||
this.message(String.fromCodePoint(this.emojis[~~(Math.random() * this.emojis.length)]));
|
||||
}, 10000);
|
||||
// setInterval(() => {
|
||||
// this.message(String.fromCodePoint(this.emojis[~~(Math.random() * this.emojis.length)]));
|
||||
// }, 10000);
|
||||
}
|
||||
|
||||
animate(name: string, reverse = false) {
|
||||
|
||||
@@ -18,12 +18,12 @@ const dog = new NPC(ctx,
|
||||
scale: 0.25
|
||||
});
|
||||
|
||||
const soldier = new NPC(ctx,
|
||||
const soldiers = Array(100).fill(null).map(() => new NPC(ctx,
|
||||
'./assets/sprites/soldier/spritesheet.png',
|
||||
'../assets/sprites/soldier/spritesheet.json', {
|
||||
bubbleOffset: [0, 32],
|
||||
scale: 1
|
||||
});
|
||||
}));
|
||||
|
||||
let frame = 0, once = true;
|
||||
setInterval(() => {
|
||||
@@ -32,6 +32,6 @@ setInterval(() => {
|
||||
clearScreen();
|
||||
|
||||
dog.tick();
|
||||
soldier.tick();
|
||||
soldiers.forEach(s => s.tick());
|
||||
})
|
||||
}, 1000 / FRAME_RATE);
|
||||
|
||||
Reference in New Issue
Block a user