Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

by Don Coyote (Hermit)
on Jun 29, 2019 at 08:39 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11102114]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (11)
As of 2024-03-28 09:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found