1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
{
id: "heart_object",
always_active: true,
vars: {
time_to_live: 5000,
},
on_create: "set(vars.time_to_live, level.cycle + vars.time_to_live)",
on_end_anim: "animation('normal')",
solid_dimensions: [],
friction: 100,
on_collide_object_item: "if(collide_with.is_player_body_part,fire_event('acquired'))",
on_acquired: "[spawn(type+'.acquisition_fx',mid_x,mid_y,facing),die()]",
timer_frequency: 10,
on_timer: "[spawn('heart_sparkle',mid_x,mid_y,0),if(level.cycle > vars.time_to_live, remove_object(me))]",
on_collide_feet: "[set(velocity_y, -velocity_y), set(velocity_x, (velocity_x*9)/10 + (velocity_y*slope_standing_on)/270),animation('flash')]",
on_collide_side: "[set(velocity_y, velocity_y/2), set(velocity_x, -velocity_x),animation('flash')]",
animation: [
{
id: "normal",
image: "props/items.png",
rect: [198,69,212,83],
pad: 3,
frames: 12,
frames_per_row: 3,
duration: 2,
item_area: "all",
solid_area: [4,4,8,8],
accel_y: 30,
},
{
id: "flash",
image: "props/items.png",
rect: [180,105,194,119],
pad: 3,
frames: 1,
duration: 4,
item_area: "all",
solid_area: [4,4,8,8],
accel_y: 20,
},
],
object_type: [
{
id: "acquisition_fx",
always_active: true,
properties: {
health_amount: 1500,
},
on_create: "[
set(level.player, 'hitpoints', level.player.hitpoints + diff) where diff = min(2, level.player.max_hitpoints - level.player.hitpoints),
sound('PickUp-Heart.ogg'),
spawn('silhouette_heart',level.player.mid_x,level.player.mid_y,1),
map([0]*10, spawn('heart_sparkle_large', level.player.mid_x, level.player.y2, 0)),
die(),
]",
animation: [
{
id: "normal",
image: "props/items.png",
rect: [198,69,199,70],
frames: 1,
duration: -1,
}],
}
],
}
|