3
solid_dimensions=enemy,common
11
turns_towards_player=0
24
choose_action="def() animation('walk')"
25
desired_facing="if(level.player.midpoint_x < self.midpoint_x, -1, 1)"
36
on_create="animation('stand')"
37
on_enter_anim="set(tmp, 'already_hit', [])"
39
on_die="[score(level,points_value), spawn_item(self), spawn('die_cloud', midpoint_x, midpoint_y, facing)]"
40
on_collide="if(collide_with != level.player, [set(velocity_x,-velocity_x/2),set(facing, -facing),animation('turn')])"
41
on_bounced_on="[add(hitpoints, -5), set(me.green, 0), set(me.blue, 0), schedule(4, [set(me.green, 255), set(me.blue, 255)]), if(jumped_on_by.mass >= 1000, die(), animation('spring'))]"
42
on_enter_water="die()"
44
on_process="set(rotate, slope_standing_on)"
45
on_timer="if(turns_at_cliffs and is_standing and animation = 'walk' and distance_to_cliff < 30,[set(facing, -facing),animation('turn')],null())"
46
on_end_turn_anim="animation('walk')"
47
on_end_walk_anim="choose_action()"
49
on_end_stand_anim="if(is_standing and 1d2 = 2, if(turns_towards_player,set_facing(self,level), choose_action()), animation('stand'))"
53
on_end_hurt_anim="animation('stand')"
55
on_end_spring_anim="animation('walk')"
58
on_surface_damage="die()"
62
#looks for the player and turns to face it#
63
def set_facing(obj,level) if(desired_facing != obj.facing, [animation('turn'),set(obj,'facing', desired_facing)], animation('walk')
64
) where desired_facing = if(level.player.x < obj.x, -1, 1);