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

2013/10/25

How to

ddvink ddvink

2013/10/25

#
In our game the floors where enemy's are walking are built up in transaparent images (they'r about 10 heigh and wide 50pxl's). So if a floor is 350 long, we placed 7 platforms. Our enemy's are able to walk on the platform, so far so good. But when they reach the end of a platform, they go on and fall down. I'm looking for a way now, that when they reach the end of the ground they turn to the other side. yours, Dennis
Gevater_Tod4711 Gevater_Tod4711

2013/10/25

#
You have to check wether there is more ground before them using the getOneObjectAtOffsetMethod. If there is a platform before them (with an offset in the moving direction and an offset because the platform is underneath them) they can go on. Otherwhise they shall turn.
You need to login to post a reply.