Quote from: wrightmat on November 01, 2018, 02:24:28 PM
I believe I borrowed my pike script from one of christopho's games, and I don't recall having any issues with it.
https://github.com/wrightmat/zbom/blob/master/data/enemies/pike_detect.lua
Nice! This one goes all 4 directions.
Ohh, it also travels only a max of 8 squares in any direction (and ensures the hero is within that range).
It's checking on_obstacle_reached as well as on_movement_finished to decide whether to send it back to its original point. Obviously "on_obstacle_reached" would be triggered when hitting the hero, hitting any other blocking object, or hitting the wall if the wall is less than 8 squares away.