This site requires JavaScript, please enable it in your browser!
Greenfoot back
xWanna
xWanna wrote ...

2015/4/16

Blocked view

xWanna xWanna

2015/4/16

#
Hey, I have a logical problem about creating a method that detects if the view of my enemy is blocked to my character. At first I thought about creating an image that draws a line between both of them and if it is intersecting with the wall would set a boolean to false that says the enemy to turn around. And the image should turn and change size to fit the line, but I searched a bit in the Internet and only found very complex ideas. Thanks for your help guys. xWanna
lordhershey lordhershey

2015/4/16

#
Someone did somehting by making actors that were lines and seeing if the line was clear or not - http://www.greenfoot.org/scenarios/11737 so you can check that scenario since the code is posted.
You need to login to post a reply.