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

2016/9/14

getOneObjectAtOffset / canSee & eat difference

greennotpurpleaki greennotpurpleaki

2016/9/14

#
Ok, a newbie here. I am seeing lots of tutorials that use either the getOneObjectAtOffset method to remove and object from the world when it is touched by another, and I am also seeing a technique using canSee and eat (which seems more straightforward to me) However I cannot get canSee / eat to work and they are not show in my documentation (do they work in Greenfoot 3.0.4 ?? - why doesn't it work for me - Thanks?
Super_Hippo Super_Hippo

2016/9/14

#
'canSee' and 'eat' are methods from the Animal class. With some version of Greenfoot, the 'isTouching' and 'removeTouching' methods were added to the Actor class which do the same as 'canSee' and 'eat'.
You need to login to post a reply.