Skip to content

Commit 644c9a1

Browse files
provide build pipeline for compressing graphics and other optimzations
1 parent a549395 commit 644c9a1

23 files changed

+630
-94
lines changed

.github/workflows/static.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,26 @@ jobs:
3131
steps:
3232
- name: Checkout
3333
uses: actions/checkout@v4
34+
35+
- name: Setup Node
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: '18'
39+
40+
- name: Install dependencies
41+
run: npm install
42+
43+
- name: Build
44+
run: npm run build
45+
3446
- name: Setup Pages
3547
uses: actions/configure-pages@v5
48+
3649
- name: Upload artifact
3750
uses: actions/upload-pages-artifact@v3
3851
with:
39-
# Upload entire repository
40-
path: '.'
52+
path: './dist'
53+
4154
- name: Deploy to GitHub Pages
4255
id: deployment
4356
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Dependencies
2+
node_modules/
3+
npm-debug.log
4+
yarn-debug.log
5+
yarn-error.log
6+
package-lock.json
7+
yarn.lock
8+
9+
# Build outputs
10+
dist/
11+
build/
12+
.vite/
13+
14+
# IDE and editor files
15+
.vscode/
16+
.idea/
17+
*.swp
18+
*.swo
19+
.DS_Store
20+
Thumbs.db
21+
22+
# Environment variables
23+
.env
24+
.env.local
25+
.env.*.local
26+
27+
# Debug logs
28+
logs/
29+
*.log
30+
npm-debug.log*
31+
yarn-debug.log*
32+
yarn-error.log*
33+
34+
# Operating System
35+
.DS_Store
36+
.DS_Store?
37+
._*
38+
.Spotlight-V100
39+
.Trashes
40+
ehthumbs.db
41+
Thumbs.db
42+
43+
# Game-specific
44+
*.save
45+
/assets/temp/
46+
/audio/temp/
47+
/sprites/working/

audio/alien-shoot.mp3

-240 KB
Binary file not shown.

audio/explosion.mp3

-5.5 MB
Binary file not shown.

audio/player-shoot.mp3

5.51 KB
Binary file not shown.

audio/player-shoot.wav

-81 KB
Binary file not shown.

audio/xeno-war.mp3

-15.7 KB
Binary file not shown.

config/crt-effect.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"scanline": {
3+
"intensity": 0.28,
4+
"count": 1024.0,
5+
"rollingSpeed": 10.3
6+
},
7+
"screenEffects": {
8+
"vignetteStrength": 0.22,
9+
"brightness": 1.1,
10+
"curvature": 0.1,
11+
"gamma": 1.2
12+
},
13+
"colorEffects": {
14+
"rgbShift": 0.0015,
15+
"saturation": 1.1,
16+
"contrast": 1.2
17+
},
18+
"blur": {
19+
"horizontal": 0.4,
20+
"samples": 5
21+
},
22+
"distortion": {
23+
"flickerSpeed": 8.0,
24+
"flickerIntensity": 0.03,
25+
"noiseAmount": 0.05,
26+
"ghosting": 0.12
27+
}
28+
}

config/image-processing.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"sprites": {
3+
"dimensions": {
4+
"alien1.png": { "width": 100, "height": 100 },
5+
"alien.png": { "width": 100, "height": 100 },
6+
"player.png": { "width": 200, "height": 200 },
7+
"xenowar.png": { "width": 1024, "height": 1024 }
8+
},
9+
"processing": {
10+
"fit": "contain",
11+
"position": "center",
12+
"colors": 16,
13+
"compression": {
14+
"quality": [0.3, 0.5],
15+
"speed": 1,
16+
"strip": true,
17+
"dithering": 0.6,
18+
"effort": 10,
19+
"adaptiveFiltering": true
20+
}
21+
}
22+
},
23+
"backgrounds": {
24+
"dimensions": {
25+
"width": 1024,
26+
"height": 1024
27+
},
28+
"processing": {
29+
"fit": "fill",
30+
"colors": 16,
31+
"compression": {
32+
"quality": [0.3, 0.5],
33+
"speed": 1,
34+
"effort": 10,
35+
"dithering": 0.5,
36+
"adaptiveFiltering": true
37+
}
38+
}
39+
},
40+
"general": {
41+
"tempDir": "temp",
42+
"outputFormat": "png",
43+
"skipExisting": false,
44+
"verifyDimensions": true
45+
}
46+
}

js/PatternFormation.js

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -383,33 +383,6 @@ class PatternFormation {
383383
this.lasers.push(laser);
384384
}
385385

386-
getPatternPosition(angle, centerX, centerY, radiusX, radiusY) {
387-
switch (this.pattern.type || 'circle') {
388-
case 'figure8':
389-
return {
390-
x: centerX + Math.sin(angle * 2) * radiusX,
391-
y: centerY + Math.sin(angle) * radiusY
392-
};
393-
case 'wave':
394-
return {
395-
x: centerX + Math.cos(angle) * radiusX,
396-
y: centerY + Math.sin(angle * 2) * radiusY * 0.5
397-
};
398-
case 'circle':
399-
default:
400-
return {
401-
x: centerX + Math.cos(angle) * radiusX,
402-
y: centerY + Math.sin(angle) * radiusY
403-
};
404-
}
405-
}
406-
407-
easeInOutCubic(t) {
408-
return t < 0.5
409-
? 4 * t * t * t
410-
: 1 - Math.pow(-2 * t + 2, 3) / 2;
411-
}
412-
413386
lerp(a, b, t) {
414387
return a + (b - a) * t;
415388
}

0 commit comments

Comments
 (0)