Per poter trascinare un oggetto basta mettere "grab me" nel codice di un oggetto:
on mouseDown grab me end mouseDownPer poi poter rilevare le collisioni basta usare la funzione intersect(), ecco tutto il codice dell'esempio nel video:
on mouseDown grab me end mouseDown
On Mousemove if intersect(image image1,image image2) then set the text of field field1 to "SI INTERSECANO" set the backgroundcolor of field field1 to 255,0,0 else set the text of field field1 to "NON SI INTERSECANO" set the backgroundcolor of field field1 to 0,255,0 end if end Mousemove
Nessun commento:
Posta un commento