Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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 drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2020-06-03 07:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (21 votes). Check out past polls.

    Notices?