Computer Science Canada

Kinda like Hit Detection

Author:  upthescale [ Sat Mar 25, 2006 10:37 pm ]
Post subject:  Kinda like Hit Detection

click on the circle and place it in the box


code:

var x, y, button, x2, y2, button2 : int
loop
    drawbox (300, 400, 536, 56, 7)
    drawfilloval (140, 312, 12, 12, 34)
    %drawfillbox (128, 300, 152, 325, 7)
    mousewhere (x, y, button)
    if x > 128 and x < 152 and y > 300 and y < 325 and button = 1 then
        cls
        exit
    end if
end loop
loop
    drawbox (300, 400, 536, 56, 7)
    mousewhere (x2, y2, button2)
    drawfilloval (x2, y2, 12, 12, 34)
    delay (30)
    drawfilloval (x2, y2, 12, 12, 0)
    if buttonmoved ("up") then
        exit
    end if
end loop
drawfilloval (x2, y2, 12, 12, 34)
if x2 >= 300 and x2 <= 536 and y2 > 56 and y2 < 400 then
 put "good"
end if

Author:  person [ Sat Mar 25, 2006 10:41 pm ]
Post subject: 

No offense, but what is this tutorial supposed to teach?
Next time, please explain your tutorial.

Author:  Delos [ Sun Mar 26, 2006 10:13 am ]
Post subject: 

Moved to [Turing Source]. No relevance to [Turing Tutorials].


: