Difference between revisions of "Line of sight"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
One of the more popular (simple) methods of determining whether something in the game world is visible (or targetable) is to input the x,y coords for the target and the player and then walk along a line between them. At each step on the line, the game checks to see if anything is in the world at these coords that would prevent a player's sight (like a wall). | One of the more popular (simple) methods of determining whether something in the game world is visible (or targetable) is to input the x,y coords for the target and the player and then walk along a line between them. At each step on the line, the game checks to see if anything is in the world at these coords that would prevent a player's sight (like a wall). | ||
One way to do it is by using the [[Breshenham's Line Algorithm]]. | |||
Revision as of 18:13, 11 February 2005
One of the more popular (simple) methods of determining whether something in the game world is visible (or targetable) is to input the x,y coords for the target and the player and then walk along a line between them. At each step on the line, the game checks to see if anything is in the world at these coords that would prevent a player's sight (like a wall).
One way to do it is by using the Breshenham's Line Algorithm.