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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access