Ok, I generally have it working, but sometimes when I'm really close to the enemy it'll go over me and not backwards(opposite x/y of it's direction).
This doesn't happen often, but it's a bug that's really annoying me... sometimes it will happen allot.
Code(Not this is from the step event, all variables are set up in the scripts)
if global.hit=true {
depth=-y
if place_free(x+lengthdir_x(8,direction),y+lengthdir_y(8,direction))
if place_free(x+lengthdir_x(8,direction),y+lengthdir_y(8,direction))
x=min(max(x,0),room_width)
y=min(max(y,0),room_height)
if (place_meeting(x,y,atc_mask)){speed=2;direction=point_direction(global.herox,global.heroy,x,y)
hero_is="l"
}}
global.hit_timer+=1
if global.hit_timer>12 {
can_move=false;
speed=0
instance_change(ai_goku,0)
global.hit_timer=0
global.hit=false
}
Note it's generally the same in all 4 objects, but only hero_is is actually changed.
Here's a demo as well, it might help with the problem visually.
Z is to do Melee attacks
X is to do Ki based attacks(only ki blast as of now, haven't coded any others yet, or implemented)
http://www.mediafire.com/?ixylfpyx5i2Also, since it's an action battle system(ABS) it will move in diagonal movements depending on where you strike the ai, that's one of my favorite things about GM, Pixel Perferctness!