This enemy ai video tutorial shows you how to make a randomly teleporting enemy that that doesn’t spawn on walls in GameMaker Studio.

The idea is quite simple. You need to define at the start a radial spawn circle and save the first x,y coordinates where the instance has been placed. This area defines possible spawn locations. Now run down a timer and when that reaches zero we try to teleport the enemy in a random x,y coordinate in that possible range. Here we check multiple times if that spot is not blocked by a wall instance and if no, we set the x,y coordinate to the random new positon. That’s it!



👑 Support me and get fresh game art and game maker projects every month:
https://www.patreon.com/1upindie

Follow me on:
📸 Instangram: https://www.instagram.com/1upindie
🐦 Twitter: https://twitter.com/1upIndie
💬 Discord: https://discord.gg/gvr98nb
📜 Udemy: https://www.udemy.com/course/become-a-video-game-developer-with-gms-23/ (See youtube about page for discount)


————————————————————–
0:00 What we will do
0:44 Subscribe
0:55 Theory of how it is done
2:15 Coding part
9:05 Game shown – Batbarian

1up Indie

View all posts

Add comment

Your email address will not be published.