{ id: "finch", activation_border: 1000, prototype: ["ant_flying"], dies_on_inactive: true, properties: { try_facing: "def(direction) if(direction != facing,fire_event('turn'))", sine_magnitude: "abs(vars.desired_height - vars.magnitude)", shooting_appropriate: "if( (abs(mid_y - level.player.mid_y) < 20) and (level.cycle - vars.last_fired) > 50 and (facing = sign(level.player.mid_x - mid_x)),1,0)", }, vars: { points_value: 14, }, consts: { basic_type: "finch", thrown_type: "finch.thrown", basic_animation: "fly", frogourmet_tag: "finch", }, on_spawned: "set(facing,if(level.player.mid_x < mid_x, -1, 1))", on_create: "[ set(vars.randphase, 1d500), set(vars.init_y, midpoint_y), set(vars.init_x, midpoint_x) ]", on_test_bounds: "#do nothing#", on_process_fly: "[ set(velocity_y, wave( min(250,max(-250, destination_height-midpoint_y ) ) )) ] where destination_height = vars.desired_height + (sin(cycle*2 + vars.randphase)*sine_magnitude)", on_process_turn: "fire_event('process_fly')", on_lose_wings: "#don't lose wings#", solid_area: null, editor_info: { category: "enemies, experimental", var: [ { name: "desired_height", type: "y", value: "midpoint_y", }, { name: "magnitude", type: "y", value: "midpoint_y+300", }, ], }, animation: [ { "@base": true, image: "enemies/bat-black.png", pad: 3, body_area: "all", accel_y: 0, feet_x: 12, feet_y: 25, accel_x: 0, }, { id: "fly", rect: [1,32,26,70], frames: 4, duration: 4, accel_x: 9, }, { id: "spring", rect: [1,32,26,70], frames: 1, duration: 3, }, { id: "turn", rect: [1,74,26,112], frames: 2, duration: 3, }, { id: "hurt", rect: [120,32,145,70], }, ], object_type: [ { id: "shot", prototype: ["shot"], traction_in_air: 1000, timer_frequency: 200, on_timer: "die()", animation: { image: "enemies/generic.png", id: "normal", duration: 60, rect: [90,5,102,17], frames: 1, attack_area: "all", accel_x: 20, }, }, { id: "thrown", prototype: ["throwable_small_enemy"], solid_dimensions: ["enemy","common"], consts: { basic_type: "finch", thrown_type: "finch.thrown", basic_animation: "fly", frogourmet_tag: "finch", }, #specifically trigger death here because non-solid objects don't have a water-level on_enter_water: "die()", on_die: "[score(level,points_value), spawn_item(self), death_burst_tracked(self)]", animation: [ { image: "enemies/bat-black.png", id: "thrown", thrown_area: "all", duration: 60, rect: [149,32,174,70], frames: 1, body_area: null, }, { image: "enemies/bat-black.png", id: "on_back", rect: [149,32,174,70], frames: 2, duration: 5, body_area: "all", }, ], }, ], }