I just learned what PHP was yesterday, and naturally, my first thought was: "What if I made Block Blast entirely in PHP?"
This was a terrible idea. I did it anyway.
This is Block Blast written in pure PHP with minimal JavaScript. Everything runs server-side. Sessions store the game state. Every click reloads the page.
Why not?
- PHP is actually pretty cool for server-side stuff
- You can make games in PHP (but maybe shouldn't)
- Sessions are neat
- Mixing PHP, HTML, CSS, and JavaScript in one file is chaotic
- I now understand why modern frameworks exist
./start.shOr:
php -S 0.0.0.0:5000Then open your browser to http://localhost:5000
- ✅ 10x10 grid
- ✅ Hover preview
- ✅ Score tracking
- ✅ Game over detection
- ✅ All in one 700+ line PHP file
- ✅ Questionable life choices
- PHP (because I just learned it)
- Vanilla JavaScript (like 50 lines)
- CSS (gradient backgrounds = professional)
- Poor decision making
Probably use literally any other approach. But hey, it works!
Do whatever you want with this. If you use it, I'm both honored and concerned.
- PHP, for being surprisingly capable
- My brain, for suggesting this in the first place
Made with confusion and determination 🎮