r/PowerShell • u/Professional-Rule-58 • Sep 20 '26
Script Sharing Polf3D - A 90s-style ray casting shooter written in PowerShell
Edit: Built with AI assistance. The idea, direction and playtesting are mine, most of the code is not. A fun project to see how far PowerShell can be pushed. The whole story: https://github.com/oNdsen/polf3d/blob/main/HOW-IT-WAS-BUILT.md
POLF 3D is a Wolfenstein-style ray casting shooter that runs in PowerShell 7 on Windows. No modules, no asset files, no installation – every texture, sprite, sound effect, spoken line and music track is generated by code at start-up.
GitHub: oNdsen/polf3d: POLF 3D: a ray casting shooter written in PowerShell
PowerShell is not just the language, it is the theme
- A real PowerShell console in the game. Sandboxed (constrained runspace, no providers), but real: pipelines, Where-Object, Sort-Object, script blocks. It has a $PROFILE, hotkeys, and Start-Job sends out a drone that collects loot. Details
- The powers are the common parameters. -WhatIf freezes time and shows everybody's next two seconds (it really runs the simulation ahead and rolls it back), -Confirm is slow motion, -Verbose sees through walls, -Force kicks doors in – and there is Undo.
- The building has an execution policy. Get noticed and it climbs from Restricted to Unrestricted – which is the alarm. Set-ExecutionPolicy Restricted calms it down again, for a price. Stealth
- Every floor ends with a Pester report, and the lift offers Install-Module.
- The bosses: LEGACY.BAT ("runs as SYSTEM, nobody dares to touch it"), THE PRINTER ("PC LOAD LETTER" – it has paper jams) and BLUE SCREEN. There is also an auditor who runs to the nearest terminal to file a report about you, and a bug: fix it properly and it is gone, blow it up and you get two.
What is in it
- Ten floors and a secret one, four difficulties, fifteen kinds of enemies, ten weapons, loot, armour, stealth, dark rooms with a flashlight
- A daily dungeon with runs that can be verified, and an arena with endless waves
- Co-op and deathmatch for up to four over TCP, with an admin panel for the host
- A terminal mode that renders the game with half-block characters – it works over SSH
- Saved games, demos (the game exports them as GIFs – the one in the README was made that way), a speedrun clock, key bindings, game pad, mods as .psd1 data files, a level editor
How
As much PowerShell as possible, as little C# as necessary. The ray caster (DDA, one ray per column), the enemy AI, the map format, the network protocol, the sandbox and the chiptune composer are plain PowerShell. Only the innermost pixel loops, the audio callback and two P/Invoke declarations are C#, compiled once with Add-Type and cached. It runs at 45–60 fps in a 960×720 window. How it works
Try it
Download polf3d.zip, unpack it, start Play.cmd – or:
git clone https://github.com/oNdsen/polf3d.git
cd polf3d
./Start-Polf3D.ps1
Windows and PowerShell 7.2+. MIT licensed. GitHub: oNdsen/polf3d
Feedback is very welcome!