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
|
[object_type]
id=breakable_block
[editor_info]
category=props
[/editor_info]
has_feet=no
on_die="[score(level,5),sound('BlockBreak.ogg'), map([0] * 10, spawn('breakable_block_particle', x + 1d10, y + 1d10, facing))]"
on_collide_object_body=" if(collide_with_area = 'attack',
if(not (me in collide_with.tmp.already_hit), [set(collide_with.tmp, 'already_hit', collide_with.tmp.already_hit + [me]),
if(animation != 'cracked', animation('cracked'), die()) ]))"
on_collide="set(velocity_x, -(velocity_x*70)/100)"
on_collide_head="set(velocity_y, -velocity_y)"
on_collide_feet="[set(velocity_x, (velocity_x*70)/100), set(velocity_y, if(abs(velocity_y) > 50, -velocity_y/2, 0))]"
on_enter_water="[
add_wave(midpoint_x, y2, -2000, 5*velocity_y/2, 30*velocity_y, 300, 300),
add_wave(midpoint_x, y2, 2000, 5*velocity_y/2, 30*velocity_y, 300, 300),
add_wave(midpoint_x, y2, -1000, 3*velocity_y/2, 20*velocity_y, 200, 200),
add_wave(midpoint_x, y2, 1000, 3*velocity_y/2, 20*velocity_y, 200, 200),
add_wave(midpoint_x, y2, -500, 2*velocity_y/2, 10*velocity_y, 100, 100),
add_wave(midpoint_x, y2, 500, 2*velocity_y/2, 10*velocity_y, 100, 100)
]"
zorder=-1
solid_area=0,0,15,15
[base:animation]
image=props/blocks.png
body_area=all
[/animation]
[animation]
id=normal
rect=0,0,15,15
frames=1
duration=100
[/animation]
[animation]
id=cracked
rect=16,0,31,15
frames=1
duration=100
[/animation]
[/object_type]
|