3 Commits

Author SHA1 Message Date
1c4c2bde8e soldier test
All checks were successful
Build / Build NPM Project (push) Successful in 25s
Build / Tag Version (push) Successful in 10s
2026-03-08 21:08:58 -04:00
7d7e17674e updates + soldier sprite
All checks were successful
Build / Build NPM Project (push) Successful in 25s
Build / Tag Version (push) Successful in 10s
2026-03-08 20:36:29 -04:00
4d688ed625 Add .github/workflows/build.yaml
All checks were successful
Build / Build NPM Project (push) Successful in 25s
Build / Tag Version (push) Successful in 3s
2023-12-06 21:47:00 +00:00
7 changed files with 617 additions and 614 deletions

37
.github/workflows/build.yaml vendored Normal file
View File

@@ -0,0 +1,37 @@
name: Build
run-name: Build
on:
push:
jobs:
build:
name: Build NPM Project
runs-on: ubuntu-latest
container: node
steps:
- name: Clone Repository
uses: ztimson/actions/clone@develop
- name: Install Dependencies
run: npm i
- name: Build Project
run: npm run build
tag:
name: Tag Version
needs: build
runs-on: ubuntu-latest
container: node
steps:
- name: Clone Repository
uses: ztimson/actions/clone@develop
- name: Get Version Number
run: echo "VERSION=$(cat package.json | grep version | grep -Eo ':.+' | grep -Eo '[[:alnum:]\.\/\-]+')" >> $GITHUB_ENV
- name: Tag Version
uses: ztimson/actions/tag@develop
with:
tag: ${{env.VERSION}}

View File

@@ -0,0 +1,14 @@
{
"width": 32,
"height": 32,
"animations": {
"idle": {
"y": 0,
"frames": 6
},
"walk": {
"y": 0,
"frames": 6
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

1152
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -8,8 +8,8 @@
"start": "npm run build && electron ./dist/main.js"
},
"devDependencies": {
"electron": "^20.0.1",
"typescript": "^4.7.4"
"electron": "^40.8.0",
"typescript": "^5.9.3"
},
"dependencies": {}
}

View File

@@ -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) {

View File

@@ -11,10 +11,19 @@ canvas.height = screenHeight;
function clearScreen() { ctx.clearRect(0, 0, screenWidth, screenHeight); }
const dog = new NPC(ctx, './assets/sprites/shadow-dog/spritesheet.png', '../assets/sprites/shadow-dog/spritesheet.json', {
bubbleOffset: [50, 75],
scale: 0.25
});
const dog = new NPC(ctx,
'./assets/sprites/shadow-dog/spritesheet.png',
'../assets/sprites/shadow-dog/spritesheet.json', {
bubbleOffset: [50, 75],
scale: 0.25
});
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(() => {
@@ -23,5 +32,6 @@ setInterval(() => {
clearScreen();
dog.tick();
soldiers.forEach(s => s.tick());
})
}, 1000 / FRAME_RATE);