jrok released a techdemo.


So, I’ve been working on designing some routines that use the playfield to draw laser beams that can destroy playfield-drawn terrain. Enclosed is my first effort, which I think could do with a lot of improvement. It its current state, my death ray does the following:

– Calculates the playfield position of the sprite from which it originated.
– Draws a progressive line in one of eight directions depending on the player’s direction when the fire button is released.
– When the laser reaches it’s full range or hits a playfield pixel, the line progressively erases (also erasing the pfpixel at its endpoint.)

Ultimately, I’ll want to add a second player, and vary the length of the death ray depending on how long the button was held down. But there are many things that i’d like to improve about this code before I can take this to the next stage. Hoping a few of you could take a crack at optimizing down this code… I’ve been staring at it all weekend and it seems to be begging for a clever function or two to tidy it up. Also, there is a small bump in the scanline count that happens during beam collisions that I can’t seem to nail down.