
-----------------------------------
needhelp
Sat Jan 15, 2005 4:43 pm

multi button
-----------------------------------
hey ppl i am tryin 2 build ma trafic light but i got one problem....i made a button dat turns on da traffic light but i am tryin 2 use da same button 2 turn off da light ...but i dont noe how 2 do it ...can sum1 plzzz help


setscreen ("graphics:vga")

%drawing my traffic
drawfillbox (420, 30, 580, 390, black)
drawfilloval (500, 320, 40, 40, grey)
drawfilloval (500, 210, 40, 40, grey)
drawfilloval (500, 100, 40, 40, grey)

%drawing the buttons that will be used to operate the traffic lights

drawfillbox (280, 260, 380, 300, red)
drawfillbox (280, 190, 380, 230, yellow)
drawfillbox (280, 120, 380, 160, green)

%turning on the trafic light
var x, y, bnum, bud : int
var gr := 0
loop
    buttonwait ("down", x, y, bnum, bud)
    if x >= 280 and x = 260 and y = 280 and x = 190 and y = 280 and x = 120 and y 