Lines of Sight (LOS)
To make all this work, I needed to trace clean lines of sight. This, it turns out, was no simple matter. Be warned: The next few pages are tediously technical. If you want to avoid the gory technical details, skip ahead to the line that says, “If you're a non-technical reader, you can resume reading now.”
Still with me? Good for you! Now, those simple 8-bit processors had no hardware multiply/divide capabilities. All calculations were carried out with 8-bit addition and subtraction. How can a program trace a straight line from point (x1, y1) to point (x2, y2) without any concept of slope (ΔY divided by ΔX)?
I couldn't just cram a software multiply/divide library into the game: There wasn't enough ROM. I needed a fast algorithm ...
Get Chris Crawford on Game Design now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.