Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: 2d field of view, vision algorithm in grid (ray casting)

by Don Coyote (Friar)
on Jun 29, 2019 at 08:39 UTC ( #11102114=note: print w/replies, xml ) Need Help??


in reply to 2d field of view, vision algorithm in grid (ray casting)

The '-' ReadKey conditional goes into negative territory. That may cause some metaphysical disturbances for our X. I'd suggest limiting the lower end of visibility.

elsif ($key eq '-'){ ! $pov_radius < 1 and $pov_radius-- }

The ReadKey function can take octal values for timings so the program will self close after some time without a keypress.

while ( my $key = ReadKey(010) ){

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11102114]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2020-11-27 15:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?