ID:1101255
|
|
I'm trying to figure out how to prevent mobs from walking off the edge of the map in my project that uses pixel movement.
|
Well, with a small project of mine, when using native pixel movement, it wotn let my bounding box overlap the edge. So I would have to assume you're using an icon_size bigger than your bounding box? You'll have to increase the bound_width and bound_height to prevent that. If you're going for the more 'artsy', I guess, route and have a icon that's top-half is a non-dense overlay; You may wish to add in a extra dense turf to the top of the maps.
|
Thanks guys. I am using Forum_account's lib, but hadn't yet wrapped my head around it completely.
|
Basically it depends on how your pixel movement code works.
You can simply block movement if the next step will result beyond the edges:
Another option is to place dense objects around the edges or the area you wish to block.