Enemy AI for Top Down Pico-8 games
A downloadable asset pack
Download NowName your own price
This is an example of how to do enemies that somewhat follow and try to seek the player.
It works like this:
- each enemy shoots sensors towards the player.
- if a sensor hits a wall, it gets deleted.
- if a sensor exceeds a set amount of time, it gets deleted.
- if a sensor hits the player, a position gets marked as a target for the enemy that emitted that sensor.
- enemies will move to their target positions.
- enemies will roam randomly when the player hasn't been detected.
- enemies have a fov: sensors are emitted only if they are inside the range of this fov.
- if the player gets too close to enemies, they will detect the player, regardless of their fov.
- if the enemy can't find the player, it will get deactivated after a set amount of frames or after it reaches its target position.
This example also features:
- a bunch of helper functions;
- animation system;
- y sorting system;
- outlined sprites;
- outlined text printing;
- floating text messages system.
If this was helpful or interesting for you, consider making a donation!
This is released under CC BY-NC-SA 4.0 https://creativecommons.org/licenses/by-nc-sa/4.0/
You can also find this on the Pico-8 Forums: https://www.lexaloffle.com/bbs/?tid=48889
Download
Download NowName your own price
Click download now to get access to the following files:
top_down_ai.p8 35 kB
Development log
- AI system for Pico-8 Top Down games!Aug 14, 2022
Comments
Log in with itch.io to leave a comment.
this is awesome, love to see pico 8 stuff.
Thank you! :D