First of all, there's an Atari 2600 game based on Portal
that came out recently, and has been making the rounds. And I tried it, and was amazed, and because all the hard stuff was already done, I thought to see what I could improve on it.
I dropped a note into that thread; maybe I can get a collaboration going with the original author.
Last night, I downloaded Batari BASIC, the "high-level" language in which this Portal "demake" was written. I learned as much as I could about it, went through the source code, and after much struggling with Batari BASIC's implementation of fixed-point arithmetic, I managed to implement realistic gravity and momentum.
When I first got involved in Atari 2600 programming back in the 1990s, and pioneered the homebrew programming culture for that system, there was nothing out there at all. Someone had run a disassembler on the source code to Combat, and scanned some technical documentation, but that was it. It was up to me and a few other people to re-learn the art.
But now, in 2008 there's a damn BASIC compiler for it, and it's better than I could have imagined. Not the "BASIC programming" cartridge, but a real BASIC compiler that lets you make programs that actually do things. It contains a general-purpose screen-drawing library, including a score, and support for a few advanced features like atlernate-frame sprites, bank switching outside the normal 4k limit, and fixed-point arithmetic. And it works by translating BASIC-like syntax into assembler source, which meant that I learned a lot, and solved a lot of problems, by looking at the ASM files it generated.
The original "Super 3D Portals 6" had the basics. Move with the left joystick (left/right, up to jump), aim your portal gun with the right joystick (left/right), and each joystick's fire button fired a different color portal. There's no momentum, so the portals are more like big square teleport traps. So you can't fling yourself across the room. But there's a goal, and several different levels, and some clever software-based collision detection that makes the movement system very robust.
In my first evening's coding session, I added momentum, at least in normal space. And gravity and jumping both follow a realistic acceleration curve now. You can try it;
it otherwise plays pretty much the same.
My next feat: make the portals work a little better. They should be able to tell if they're on a horizontal or vertical surface, and rotate the player's momentum accordingly. But to get much more code in, I'd have to either use bank switching, or assembler-optimize much of the code.
After that, well, that's as far ahead as I've thought. Things like redesigning the levels, or adding lethal obstacles, are things I haven't thought about yet, and the original author might step back in to implement those. It probably doesn't help that I still haven't played Valve's original Portal yet.