/* GWORLD4_OBJECTS.P */ section $-objects; lib pb_objects.p; ;;; Called after bug has moved and world has been updated with its action. ;;; define my_update(); lvars i, j, id; for i from 0 to bw_world_width($-eden$-world)-1 do for j from 0 to bw_world_height($-eden$-world)-1 do ($-eden$-world.$-worlds$-world_contents)(i,j) -> id; $-worlds$-message( [update], id, i, j ); endfor; endfor; enddefine; define bomb( message, id, x, y ); lvars message, id, x, y; lvars i, j; switchon message case =[update] then if distance( x, y, bug_xW(), bug_yW() ) < 2 then kill( 'You have been blown up by the bomb!' ); endif; else portable( message, id, x, y ); endswitchon enddefine; define_object( "bomb", bomb, `b` ); endsection;