Compare commits
10
Commits
laptop-backup
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c4c2bde8e | ||
|
|
7d7e17674e | ||
|
|
4d688ed625 | ||
|
|
295de3ee01 | ||
|
|
0212ab13a2 | ||
|
|
456267e200 | ||
|
|
ad9703eb8f | ||
|
|
2c2d2588fc | ||
|
|
d310cbb1a2 | ||
|
|
2f9d51b68c |
@@ -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}}
|
||||
@@ -0,0 +1,11 @@
|
||||
Copyright (c) 2023 Zakary Timson
|
||||
|
||||
All Rights Reserved.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -1,5 +1,72 @@
|
||||
# TSElectronTemplate
|
||||
This is a minimalist setup to get TypeScript & Electron working. It includes nothing extra.
|
||||
|
||||
## Table of Contents
|
||||
[[_TOC_]]
|
||||
<!-- Header -->
|
||||
<div id="top" align="center">
|
||||
<br />
|
||||
|
||||
<!-- Logo -->
|
||||
<img src="https://git.zakscode.com/repo-avatars/c3df2b0fe775af37194771569752d82e54c81ba8a5493540bf14ec6bf1eadd9d" alt="Logo" width="200" height="200">
|
||||
|
||||
<!-- Title -->
|
||||
### Desktop Daemon
|
||||
|
||||
<!-- Description -->
|
||||
Virtual Desktop Pets
|
||||
|
||||
<!-- Repo badges -->
|
||||
[](https://git.zakscode.com/ztimson/desktop-daemon/tags)
|
||||
[](https://git.zakscode.com/ztimson/desktop-daemon/pulls)
|
||||
[](https://git.zakscode.com/ztimson/desktop-daemon/issues)
|
||||
|
||||
<!-- Links -->
|
||||
|
||||
---
|
||||
<div>
|
||||
<a href="https://git.zakscode.com/ztimson/desktop-daemon/releases" target="_blank">Release Notes</a>
|
||||
• <a href="https://git.zakscode.com/ztimson/desktop-daemon/issues/new?template=.github%2fissue_template%2fbug.md" target="_blank">Report a Bug</a>
|
||||
• <a href="https://git.zakscode.com/ztimson/desktop-daemon/issues/new?template=.github%2fissue_template%2fenhancement.md" target="_blank">Request a Feature</a>
|
||||
</div>
|
||||
|
||||
---
|
||||
</div>
|
||||
|
||||
## Table of Contents
|
||||
- [Template](#top)
|
||||
- [About](#about)
|
||||
- [Built With](#built-with)
|
||||
- [Setup](#setup)
|
||||
- [Development](#development)
|
||||
- [License](#license)
|
||||
|
||||
## About
|
||||
|
||||
<img alt="Screenshot" src="./screenshot.gif" width="60%" height="auto">
|
||||
|
||||
Desktop Daemon is an experimental game I used to learn sprites. You can create customziable pets which live on your desktop. They can largly be ignored as they play along your taskbar but need attention from time to time.
|
||||
|
||||
DD was writen completely froms scratch using TypeScript and Electron.
|
||||
|
||||
### Built With
|
||||
[](https://www.electronjs.org/)
|
||||
[](https://typescriptlang.org/)
|
||||
|
||||
## Setup
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
<h3 id="development" style="display: inline">
|
||||
Development
|
||||
</h3>
|
||||
</summary>
|
||||
|
||||
#### Prerequisites
|
||||
- [Node.js](https://nodejs.org/en/download)
|
||||
|
||||
#### Instructions
|
||||
1. Install the dependencies: `npm install`
|
||||
2. Start the Angular server: `npm run start`
|
||||
|
||||
</details>
|
||||
|
||||
## License
|
||||
Copyright © 2023 Zakary Timson | All Rights Reserved
|
||||
|
||||
See the [license](./LICENSE) for more information.
|
||||
|
||||
@@ -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 |
Generated
+547
-605
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -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": {}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.0 MiB |
+4
-4
@@ -19,7 +19,7 @@ export class NPC {
|
||||
private sprite!: any;
|
||||
private text: string;
|
||||
|
||||
public pos = [0, 0];
|
||||
public pos = [1000, 0];
|
||||
public vel = [0, 0];
|
||||
|
||||
constructor(private readonly ctx: CanvasRenderingContext2D,
|
||||
@@ -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) {
|
||||
|
||||
+14
-4
@@ -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);
|
||||
|
||||
Generated
+11229
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user