1{ 2id: "coin_gold_bouncy", 3on_create: "[add_particles('particles'), set(vars.time_to_live, level.cycle + vars.time_to_live)]", 4collide_dimensions: ["~item"], 5on_collide_object_item: "if(collide_with.is_player_body_part,fire_event('acquired'))", 6on_end_anim: "animation('normal')", 7on_acquired: "[gold(level,5),map([0,0,0,0],spawn('coin_sparkle',midpoint_x + 1d40-20,midpoint_y + 1d40-20,0)),sound('coin.ogg'), 8 9 die()]", 10 11vars: {time_to_live: 500}, 12 13on_collide_head: "[set(velocity_y, (-velocity_y*9)/10), set(velocity_x, (velocity_x*9)/10), set(brightness, 500),schedule(2, set(brightness, 255))]", 14on_collide_feet: "[set(velocity_y, -velocity_y), set(velocity_x, (velocity_x*9)/10 + (velocity_y*slope_standing_on)/90), set(brightness, 500),schedule(2, set(brightness, 255))]", 15on_collide_side: "[set(velocity_y, velocity_y/2), set(velocity_x, -velocity_x), set(brightness, 500),schedule(2, set(brightness, 255)),]", 16timer_frequency: 50, 17on_timer: "if(level.cycle > vars.time_to_live, die())", 18 19animation: { 20 id: "normal", 21 image: "props/items.png", 22 rect: [4,84,18,98], 23 solid_area: [4,4,8,8], 24 pad: 3, 25 frames: 6, 26 duration: 8, 27 item_area: "all", 28 accel_y: 80, 29}, 30particle_system: { 31 id: "particles", 32 type: "simple", 33 min_y: -10, 34 max_y: 30, 35 min_x: -10, 36 max_x: 30, 37 spawn_rate: 10, 38 time_to_live: 18, 39 animation: [ 40 { 41 id: "sparkle", 42 image: "props/items.png", 43 rect: [139,88,149,98], 44 frames: 4, 45 pad: 3, 46 duration: 6, 47 }, 48 { 49 50 # 51 #same thing, but skip the first frame 52 id: "sparkle", 53 image: "props/items.png", 54 rect: [153,88,163,98], 55 frames: 3, 56 pad: 3, 57 duration: 4, 58 }, 59 { 60 61 # 62 #same thing, but skip the first 2 frames 63 id: "sparkle", 64 image: "props/items.png", 65 rect: [167,88,177,98], 66 frames: 2, 67 pad: 3, 68 duration: 6, 69 }, 70 ], 71}, 72} 73