Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2511538
update devDependencies
nicfv Aug 22, 2026
78770ed
update dependencies for orbit-idle
nicfv Aug 22, 2026
3862b2b
update artifact path
nicfv Aug 22, 2026
bfe83b8
ignore site/ output
nicfv Aug 22, 2026
1136315
clean site/ instead of dist
nicfv Aug 22, 2026
e45cba8
add audio, update script src
nicfv Aug 22, 2026
b9b95f3
capture audio src from html element
nicfv Aug 22, 2026
9d4b3e3
create built outputs in site/<dir>/index.html
nicfv Aug 22, 2026
acc9787
remove release workflow
nicfv Aug 22, 2026
0c16fa5
remove space game (not really a game)
nicfv Aug 22, 2026
4373f07
fix script srcs
nicfv Aug 22, 2026
b69ba55
remove tools index page (i forgot this still existed!!)
nicfv Aug 22, 2026
23d33da
update script srcs for tools
nicfv Aug 22, 2026
a2ee696
update versions where applicable (tools)
nicfv Aug 22, 2026
1c30053
remove release files
nicfv Aug 22, 2026
49f1b80
update versions where applicable
nicfv Aug 22, 2026
6081344
update nicfv npm versions
nicfv Aug 22, 2026
3ddda7b
update nicfv npm versions
nicfv Aug 22, 2026
7a4627d
fix smath for pokemongo
nicfv Aug 22, 2026
bf6ba77
fix
nicfv Aug 22, 2026
23a29e6
remove smath dep
nicfv Aug 22, 2026
b450b1a
fix hexles
nicfv Aug 22, 2026
bd39e45
fix ce
nicfv Aug 22, 2026
4dc1c59
fix b
nicfv Aug 22, 2026
184cb0a
no arguments needed
nicfv Aug 22, 2026
6ec1cad
no need for bun clean
nicfv Aug 22, 2026
64f8fec
not zipping files anymore
nicfv Aug 22, 2026
66c5cb8
bun never creates `package-lock.json`
nicfv Aug 22, 2026
b09ea3d
add zip subcommand
nicfv Aug 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Build Project
run: bun start && bun clean prod
run: bun start
- name: Setup Pages
uses: actions/configure-pages@v6
- name: Upload artifact
uses: actions/upload-pages-artifact@v5
with:
path: 'www'
path: 'site'
deploy:
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
Expand Down
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
node_modules
package-lock.json
bun.lock
dist
*.zip
site
15 changes: 1 addition & 14 deletions cmd/clean
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,8 @@ if [[ ! -f 'cmd/clean' ]] ; then
exit 1
fi

# Check to make sure a single argument was provided
if [[ "${#}" -ne 1 ]] ; then
echo "Usage: ${0} <dev|prod>"
exit 1
fi

# Select files to delete
if [[ "${1}" == 'dev' ]] ; then
files=('node_modules' 'dist' 'bun.lock' '*.zip')
elif [[ "${1}" == 'prod' ]] ; then
files=('node_modules' 'src' 'package.json' '*.md' '*.zip' 'release')
else
echo "Unknown argument ${1}."
exit 1
fi
files=('node_modules' 'bun.lock' 'site')

# Delete corresponding files
for file in "${files[@]}" ; do
Expand Down
6 changes: 0 additions & 6 deletions cmd/release

This file was deleted.

11 changes: 10 additions & 1 deletion cmd/start
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,14 @@ else
exit 1
fi

# Create project output directory
name="../../../site/$(basename "${PWD}")"
mkdir -p "${name}"

# Lint and build project
bun x tsc --noEmit && bun x eslint src && bun build "${args[@]}" --outfile=dist/main.js src/index.ts
bun x tsc --noEmit && bun x eslint src && bun build "${args[@]}" --compile --target=browser ./index.html --outfile="${name}/index.html"

# Package for releasing
if [[ "${2}" == 'zip' ]] ; then
zip -r "${name}/release.zip" "${name}/index.html"
fi
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"www/**/*"
],
"devDependencies": {
"eslint": "10.8.1",
"eslint": "10.9.0",
"@eslint/js": "10.0.1",
"typescript-eslint": "8.66.0"
"typescript-eslint": "8.67.0"
}
}
2 changes: 1 addition & 1 deletion www/games/ballistic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<meta name="author" content="Nicolas Ventura">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="dist/main.js" defer></script>
<script type="text/javascript" src="src/index.ts" defer></script>
<script type="text/javascript" src="https://nicfv.com/media/tag.js" defer></script>
</head>

Expand Down
4 changes: 2 additions & 2 deletions www/games/ballistic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"start": "../../../cmd/start"
},
"dependencies": {
"graphico": "1.2.1",
"smath": "1.15.1"
"graphico": "1.7.0",
"smath": "3.1.0"
}
}
6 changes: 3 additions & 3 deletions www/games/ballistic/src/ball.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Drawable } from 'graphico';
import { Rod } from './rod';
import { Hole } from './hole';
import { clamp, translate } from 'smath';
import { SMath } from 'smath';

export class Ball implements Drawable {
private rolling = false;
Expand Down Expand Up @@ -141,8 +141,8 @@ export class Ball implements Drawable {
public draw(graphics: CanvasRenderingContext2D): void {
// Save and manipulate
graphics.save();
const yTranslate: number = translate(clamp(this.fallDuration, 0, this.fallAnimDurationSec), 0, this.fallAnimDurationSec, 0, this.r / 2);
const scaleFactor: number = translate(clamp(this.fallDuration, 0, this.fallAnimDurationSec), 0, this.fallAnimDurationSec, 1, 0);
const yTranslate: number = SMath.translate(SMath.clamp(this.fallDuration, 0, this.fallAnimDurationSec), 0, this.fallAnimDurationSec, 0, this.r / 2);
const scaleFactor: number = SMath.translate(SMath.clamp(this.fallDuration, 0, this.fallAnimDurationSec), 0, this.fallAnimDurationSec, 1, 0);
graphics.translate(this.x, this.y + yTranslate);
graphics.scale(scaleFactor, scaleFactor);
graphics.rotate(this.angle);
Expand Down
6 changes: 3 additions & 3 deletions www/games/ballistic/src/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Ball } from './ball';
import { Rod } from './rod';
import { Hole } from './hole';
import { Progress } from './progress';
import { rint } from 'smath';
import { SMath } from 'smath';

export type Difficulty = 'Easy' | 'Medium' | 'Hard' | 'X-treme';

Expand Down Expand Up @@ -156,8 +156,8 @@ export class Game implements Drawable {
this.rod = new Rod(height - vPadding, height - vPadding, width, height, 100, 10);
const holeR: number = ballR * holeRFac;
this.holes = [];
for (let y = height - vPadding - holeR * 3; y > vPadding; y -= rint(1, holeR)) {
const hole = new Hole(rint(holeR * 3, width - holeR * 3), y, holeR, holePadding);
for (let y = height - vPadding - holeR * 3; y > vPadding; y -= SMath.rint(1, holeR)) {
const hole = new Hole(SMath.rint(holeR * 3, width - holeR * 3), y, holeR, holePadding);
let intersects = false;
for (const existingHole of this.holes) {
if (hole.intersects(existingHole)) {
Expand Down
16 changes: 8 additions & 8 deletions www/games/ballistic/src/rod.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Drawable } from 'graphico';
import { translate, clamp } from 'smath';
import { SMath } from 'smath';

type Control = 'Up' | 'Down' | 'None';

Expand Down Expand Up @@ -33,7 +33,7 @@ export class Rod implements Drawable {
* Get the height of the rod at a certain X-position.
*/
public getY(x: number): number {
return translate(x, this.lx, this.rx, this.ly, this.ry);
return SMath.translate(x, this.lx, this.rx, this.ly, this.ry);
}
/**
* Move the rod based on user input.
Expand All @@ -45,28 +45,28 @@ export class Rod implements Drawable {
} else if (left === 'Down') {
this.ly += speed;
}
this.ly = clamp(this.ly, this.width, this.gameHeight - this.width);
this.ly = SMath.clamp(this.ly, this.width, this.gameHeight - this.width);
if (right === 'Up') {
this.ry -= speed;
} else if (right === 'Down') {
this.ry += speed;
}
this.ry = clamp(this.ry, this.width, this.gameHeight - this.width);
this.ry = SMath.clamp(this.ry, this.width, this.gameHeight - this.width);
}
/**
* Move the rod to a specified position and return `true` when it has reached it.
*/
public reset(dt: number): boolean {
const px: number = this.px_per_sec * dt / 1000;
if (this.ly > this.startLeft) {
this.ly = clamp(this.ly - px, this.startLeft, this.ly);
this.ly = SMath.clamp(this.ly - px, this.startLeft, this.ly);
} else if (this.ly < this.startLeft) {
this.ly = clamp(this.ly + px, this.ly, this.startLeft);
this.ly = SMath.clamp(this.ly + px, this.ly, this.startLeft);
}
if (this.ry > this.startRight) {
this.ry = clamp(this.ry - px, this.startRight, this.ry);
this.ry = SMath.clamp(this.ry - px, this.startRight, this.ry);
} else if (this.ry < this.startRight) {
this.ry = clamp(this.ry + px, this.ry, this.startRight);
this.ry = SMath.clamp(this.ry + px, this.ry, this.startRight);
}
return this.ly === this.startLeft && this.ry === this.startRight;
}
Expand Down
2 changes: 1 addition & 1 deletion www/games/ballistic/src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = '1.1.1';
export const version = '1.2.0';
2 changes: 1 addition & 1 deletion www/games/cave-explorer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>Cave Explorer</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="dist/main.js" defer></script>
<script type="text/javascript" src="src/index.ts" defer></script>
<script type="text/javascript" src="https://nicfv.com/media/tag.js" defer></script>
</head>

Expand Down
6 changes: 3 additions & 3 deletions www/games/cave-explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"start": "../../../cmd/start"
},
"dependencies": {
"graphico": "1.2.1",
"smath": "1.15.1",
"viridis": "1.4.2"
"graphico": "1.7.0",
"smath": "3.1.0",
"viridis": "1.7.0"
}
}
2 changes: 1 addition & 1 deletion www/games/cave-explorer/src/map.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Drawable } from 'graphico';
import { allDirections, Direction, move, tileSize, Vec2 } from './types';
import * as SMath from 'smath';
import { SMath } from 'smath';

export class GameMap implements Drawable {
private readonly tiles: TileType[][];
Expand Down
2 changes: 1 addition & 1 deletion www/games/cave-explorer/src/minimap.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as SMath from 'smath';
import { SMath } from 'smath';
import { Drawable } from 'graphico';
import { GameMap } from './map';
import { Player } from './player';
Expand Down
2 changes: 1 addition & 1 deletion www/games/cellsplit/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<meta name="author" content="Nicolas Ventura">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="dist/main.js" defer></script>
<script type="text/javascript" src="src/index.ts" defer></script>
<script type="text/javascript" src="https://nicfv.com/media/tag.js" defer></script>
</head>

Expand Down
2 changes: 1 addition & 1 deletion www/games/cellsplit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"start": "../../../cmd/start"
},
"dependencies": {
"graphico": "1.2.1"
"graphico": "1.7.0"
}
}
2 changes: 1 addition & 1 deletion www/games/geomarin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
content="A daily puzzle game dedicated to the unique architecture and natural beauty of Marin county, California.">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="assets/main.css">
<script type="text/javascript" src="dist/main.js" defer></script>
<script type="text/javascript" src="src/index.ts" defer></script>
</head>

<body>
Expand Down
4 changes: 2 additions & 2 deletions www/games/geomarin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"start": "../../../cmd/start"
},
"dependencies": {
"graphico": "1.6.0",
"smath": "3.0.0"
"graphico": "1.7.0",
"smath": "3.1.0"
}
}
2 changes: 1 addition & 1 deletion www/games/geomarin/src/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const global = {
/**
* Application version number
*/
version: '1.1',
version: '1.2',
/**
* Colors for SVG paths (regions)
*/
Expand Down
5 changes: 5 additions & 0 deletions www/games/hexles/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changes

## 1.1.5

- Compile into a standalone HTML page
- Update `graphico` (1.7.0) and `smath` (3.1.0) dependencies

## 1.1.4

- Update `graphico` dependency version (1.2.1)
Expand Down
2 changes: 1 addition & 1 deletion www/games/hexles/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="icon" type="image/x-icon" href="icon.svg" />
<script type="text/javascript" src="dist/main.js" defer></script>
<script type="text/javascript" src="src/index.ts" defer></script>
<script type="text/javascript" src="https://nicfv.com/media/tag.js" defer></script>
</head>

Expand Down
4 changes: 2 additions & 2 deletions www/games/hexles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"start": "../../../cmd/start"
},
"dependencies": {
"graphico": "1.2.1",
"smath": "1.15.1"
"graphico": "1.7.0",
"smath": "3.1.0"
}
}
14 changes: 7 additions & 7 deletions www/games/hexles/src/Game.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { clamp, selectRandom, selectRandomWeighted } from 'smath';
import { SMath } from 'smath';
import { Drawable } from 'graphico';
import { Hexagon, Vec2 } from './Geometry';
import { VERSION } from './version';
Expand Down Expand Up @@ -37,7 +37,7 @@ class Player implements Drawable {
if (unusedColors.length === 0) {
throw new Error('All colors are in use.');
}
this.color = selectRandom(unusedColors);
this.color = SMath.selectRandom(unusedColors);
}
Player.ColorMap[this.color].inUse = true;
this.dPad = new DPad(this);
Expand Down Expand Up @@ -224,7 +224,7 @@ class Board implements Drawable {
if (neutralTiles.length === 0) {
throw new Error('No neutral tiles left.');
}
const tile: Tile = selectRandom(neutralTiles);
const tile: Tile = SMath.selectRandom(neutralTiles);
tile.capture(player);
}
/**
Expand Down Expand Up @@ -447,9 +447,9 @@ class Game implements Drawable {
this.paused = false;
this.board = new Board(boardSize, wallDensity);
this.turnText = new Text('', 22, { x: 0.01, y: 0.01 });
numHumans = clamp(numHumans, 0, Game.MAX_PLAYERS);
numAI = clamp(numAI, 0, Game.MAX_PLAYERS);
numAI = clamp(numAI, Game.MIN_PLAYERS - numHumans, Game.MAX_PLAYERS - numHumans);
numHumans = SMath.clamp(numHumans, 0, Game.MAX_PLAYERS);
numAI = SMath.clamp(numAI, 0, Game.MAX_PLAYERS);
numAI = SMath.clamp(numAI, Game.MIN_PLAYERS - numHumans, Game.MAX_PLAYERS - numHumans);
for (let i = 0; i < numHumans; i++) {
this.players.push(new Player(favoriteColor, false));
}
Expand Down Expand Up @@ -535,7 +535,7 @@ class Game implements Drawable {
if (this.turnOrder.getCurrentPlayer().isAI) {
const bucketNames: Direction[] = ['North', 'NorthEast', 'NorthWest', 'South', 'SouthEast', 'SouthWest'],
buckets: number[] = bucketNames.map(name => this.board.captureWeight(this.turnOrder.getCurrentPlayer(), name)),
selectedDirection = bucketNames[selectRandomWeighted(buckets)]; // Note: is `undefined` when there are no legal moves
selectedDirection = bucketNames[SMath.selectRandomWeighted(buckets)]; // Note: is `undefined` when there are no legal moves
let startThinkTime: number = this.time + 500; // Wait 0.5 sec before "thinking"
const aiTick = setInterval(() => {
const elapsedTime: number = this.time - startThinkTime;
Expand Down
2 changes: 1 addition & 1 deletion www/games/hexles/src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '1.1.4';
export const VERSION = '1.1.5';
3 changes: 2 additions & 1 deletion www/games/orbit-idle/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
<meta name="author" content="Nicolas Ventura">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link type="text/css" rel="stylesheet" href="index.css">
<script type="text/javascript" src="dist/main.js" defer></script>
<script type="text/javascript" src="src/index.ts" defer></script>
<script type="text/javascript" src="https://nicfv.com/media/tag.js" defer></script>
</head>

<body>
<h1>Orbit Idle</h1>
<div id="game"></div>
<audio id="music" src="./Between_The_Sleepless_Stars.mp3"></audio>
<div id="game-info">
<button id="close-info" title="Close game information." onclick="document.body.removeChild(document.getElementById('game-info'))">x</button>
<p><i>This game takes a new <b>spin</b> as the 4th game in the Revolution Idle series.</i></p>
Expand Down
9 changes: 4 additions & 5 deletions www/games/orbit-idle/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"name": "orbit-idle",
"scripts": {
"start": "../../../cmd/start",
"release": "../../../cmd/release"
"start": "../../../cmd/start"
},
"dependencies": {
"graphico": "1.6.0",
"smath": "3.0.0",
"viridis": "1.6.1"
"graphico": "1.7.0",
"smath": "3.1.0",
"viridis": "1.7.0"
}
}
Loading