2026-11-13 00:41:54 +01:00
|
|
|
# Builds everything into release\:
|
|
|
|
|
# RobotClash.exe one self-contained file (.NET runtime + game embedded, WebView2 window)
|
|
|
|
|
# robotclash.html whole game in one HTML file
|
|
|
|
|
# robotclash-web.zip upload package for itch.io & co (the page as index.html)
|
|
|
|
|
# Needs .NET 8+ SDK and Node. The PC running the exe needs the Edge WebView2 Runtime (Win 10/11 has it).
|
|
|
|
|
# .\build.ps1 all .\build.ps1 -Web only HTML + zip .\build.ps1 -Exe only exe
|
Online-Lobby, Arenen, Lackiererei, ComfyGen-Grafik, Verschleierung
Grosse Erweiterung ueber die erste spielbare Version hinaus:
- Online (Firebase ueber REST, kein SDK): Konto per E-Mail, globale Lobby
mit Laender-Raeumen, Herausfordern, Live-PvP (Host rechnet, Gast
interpoliert, KI-Uebernahme bei Lag). Gast kann anonym beitreten.
net.js / lobby.js / netfight.js, Regeln in docs/firebase.
- 3 Arenen in verschiedenen Groessen (RC.ARENAS, half 8/12/16), Kamera +
Licht + Boden skalieren; Liga skaliert die Arena mit, Setting + online
aus Seed. Harte Rams/Wandtreffer schleudern Roboter auf den Rucken.
- Intro (3D-Kamerafahrt), Titel, Einstellungen (Kamera, Schwierigkeit,
Steuerung, Grafik, Arena), Lackiererei (painter.js, selbst bemalen).
- Shop mit ComfyGen-Sprites (aus den 3D-Teilen erzeugt), Liga-Gegner sehen
aus wie ihre Portraits (looks.js), kraeftigere Waffen-Modelle.
- Oekonomie: Startgeld 800, Schadensbonus, Schaukaempfe, Online-Preisgeld.
- Verschleierung: build.ps1 -Obfuscate (terser), tablet-taugliche Touch-UI.
- Tests: tests/sim.test.js, balance.js, online.test.js. Dev-Tools in tools/.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-13 15:45:35 +01:00
|
|
|
param([switch]$Web, [switch]$Exe, [switch]$Obfuscate)
|
2026-11-13 00:41:54 +01:00
|
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
|
$root = $PSScriptRoot
|
|
|
|
|
$out = Join-Path $root 'release'
|
|
|
|
|
if (-not $Web -and -not $Exe) { $Web = $true; $Exe = $true }
|
|
|
|
|
New-Item -ItemType Directory -Force $out | Out-Null
|
|
|
|
|
|
|
|
|
|
if ($Exe) {
|
|
|
|
|
# app icon from game\assets\Sprites\icon.png (once; delete launcher\app.ico to redo)
|
|
|
|
|
$ico = Join-Path $root 'launcher\app.ico'
|
|
|
|
|
$png = Join-Path $root 'game\assets\Sprites\icon.png'
|
|
|
|
|
if (-not (Test-Path $ico) -and (Test-Path $png)) {
|
|
|
|
|
py -3.12 -c "import sys; from PIL import Image; Image.open(sys.argv[1]).convert('RGBA').save(sys.argv[2], sizes=[(16,16),(24,24),(32,32),(48,48),(64,64),(128,128),(256,256)])" $png $ico
|
|
|
|
|
}
|
|
|
|
|
$pub = Join-Path $env:TEMP 'robotclash-publish'
|
|
|
|
|
Remove-Item $pub -Recurse -Force -ErrorAction SilentlyContinue
|
|
|
|
|
dotnet publish (Join-Path $root 'launcher\Launcher.csproj') -c Release -o $pub --nologo
|
|
|
|
|
if ($LASTEXITCODE -ne 0) { throw "dotnet publish failed ($LASTEXITCODE)" }
|
|
|
|
|
Copy-Item (Join-Path $pub 'RobotClash.exe') $out -Force
|
|
|
|
|
Remove-Item $pub -Recurse -Force
|
|
|
|
|
$exeFile = Get-Item (Join-Path $out 'RobotClash.exe')
|
|
|
|
|
"Fertig: $($exeFile.FullName) ($([math]::Round($exeFile.Length / 1MB, 1)) MB)"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($Web) {
|
Online-Lobby, Arenen, Lackiererei, ComfyGen-Grafik, Verschleierung
Grosse Erweiterung ueber die erste spielbare Version hinaus:
- Online (Firebase ueber REST, kein SDK): Konto per E-Mail, globale Lobby
mit Laender-Raeumen, Herausfordern, Live-PvP (Host rechnet, Gast
interpoliert, KI-Uebernahme bei Lag). Gast kann anonym beitreten.
net.js / lobby.js / netfight.js, Regeln in docs/firebase.
- 3 Arenen in verschiedenen Groessen (RC.ARENAS, half 8/12/16), Kamera +
Licht + Boden skalieren; Liga skaliert die Arena mit, Setting + online
aus Seed. Harte Rams/Wandtreffer schleudern Roboter auf den Rucken.
- Intro (3D-Kamerafahrt), Titel, Einstellungen (Kamera, Schwierigkeit,
Steuerung, Grafik, Arena), Lackiererei (painter.js, selbst bemalen).
- Shop mit ComfyGen-Sprites (aus den 3D-Teilen erzeugt), Liga-Gegner sehen
aus wie ihre Portraits (looks.js), kraeftigere Waffen-Modelle.
- Oekonomie: Startgeld 800, Schadensbonus, Schaukaempfe, Online-Preisgeld.
- Verschleierung: build.ps1 -Obfuscate (terser), tablet-taugliche Touch-UI.
- Tests: tests/sim.test.js, balance.js, online.test.js. Dev-Tools in tools/.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-13 15:45:35 +01:00
|
|
|
# -Obfuscate: minify/mangle own scripts in the single-file HTML (needs `npm install`, terser)
|
|
|
|
|
$env:RC_OBFUSCATE = if ($Obfuscate) { '1' } else { '0' }
|
2026-11-13 00:41:54 +01:00
|
|
|
node (Join-Path $root 'build-web.mjs')
|
|
|
|
|
if ($LASTEXITCODE -ne 0) { throw "web build failed ($LASTEXITCODE)" }
|
|
|
|
|
$tmp = Join-Path $env:TEMP 'robotclash-web'
|
|
|
|
|
Remove-Item $tmp -Recurse -Force -ErrorAction SilentlyContinue
|
|
|
|
|
New-Item -ItemType Directory $tmp | Out-Null
|
|
|
|
|
Copy-Item (Join-Path $out 'robotclash.html') (Join-Path $tmp 'index.html')
|
|
|
|
|
Compress-Archive -Path (Join-Path $tmp 'index.html') -DestinationPath (Join-Path $out 'robotclash-web.zip') -Force
|
|
|
|
|
Remove-Item $tmp -Recurse -Force
|
|
|
|
|
"Fertig: $(Join-Path $out 'robotclash-web.zip')"
|
|
|
|
|
}
|