const block_max = 1000 const sx = 800, sy = 600, tile_size = 50 screenres sx, sy, 32 type block_type as integer x, y, size as integer isvertical as uinteger c as integer pixelx, pixely 'must agree with the x, y, and isvertical values end type type mouse_type as integer x, y, b end type dim shared as integer block_total dim shared as block_type block(1 to block_max) dim shared as mouse_type mouse, mouse_p dim shared as integer mouse_piece randomize() for i as integer = 1 to 3 block_total += 1 with block(block_total) .x = i * 2 * tile_size .y = i * 2 * tile_size .size = int(rnd() * 2) + 2 .isvertical = (i and 1) .c = rgb(rnd() * 256, rnd() * 256, rnd() * 256) if .isvertical then .pixelx = tile_size .pixely = tile_size * .size else .pixelx = tile_size * .size .pixely = tile_size end if end with next i do mouse_p = mouse getmouse(mouse.x, mouse.y,, mouse.b) if mouse.b > 0 and mouse_p.b = 0 then mouse_piece = 0 for i as integer = 1 to block_total with block(i) if mouse.x > .x and mouse.x < .x + .pixelx then if mouse.y > .y and mouse.y < .y + .pixely then mouse_piece = i end if end if end with next i end if if mouse.b > 0 and mouse_p.b > 0 and mouse_piece > 0 then with block(mouse_piece) if .isvertical then .y += mouse.y - mouse_p.y else .x += mouse.x - mouse_p.x end if end with end if if mouse.b = 0 and mouse_p.b > 0 and mouse_piece > 0 then with block(mouse_piece) .x = int(.5 + .x / tile_size) * tile_size .y = int(.5 + .y / tile_size) * tile_size end with end if screenlock() cls() for i as integer = 1 to block_total with block(i) line (.x, .y) - step(.pixelx, .pixely), .c, BF end with next i screenunlock() sleep(18, 1) 'arbitrary loop until inkey() = chr(27)