38
player_within="def(distance) if((level.player.midpoint_x > midpoint_x - distance) and (level.player.midpoint_x < midpoint_x + distance) and (level.player.midpoint_y > midpoint_y - distance) and (level.player.midpoint_y < midpoint_y + distance), 1, 0)"
40
ideal_x="def() ((vars.x2_bound + vars.x_bound) / 2)"
42
inside_aggro_range="def(distance) if(abs(ideal_x() - midpoint_x) < distance, 1, 0)"
44
target_y="def() (vars.desired_height)"
49
on_hit_by_player="die()"
50
on_die="[score(level,20), spawn_item(me), spawn('die_cloud', midpoint_x, midpoint_y, facing)]"
53
on_timer="if(solid(level, front + facing*90, y, 1, y2 - y),
56
on_end_anim="[set(tmp.already_hit, [])]"
58
on_end_hurt_anim="set(animation, 'swim')"
60
on_end_swim_anim="if(facing < 0 and x < vars.x_bound or
61
facing > 0 and x2 > vars.x2_bound,
62
[facing(-facing), animation('swim')],
67
on_collide="[set(velocity_x, 0), facing(-facing)]"
68
on_change_animation_failure="die()"
73
on_process_swim="if(abs(y - target_y()) > 10, set(accel_y, (20*if(target_y() < y, -1, 1))), [set(accel_y,0)])"
77
image=enemies/fish-blue-darter.png
93
id=swim #blink variant