setscreen ("graphics:vga")
%Next four lines sets up the diagram of a traffic light
drawbox (270,140,330,310,14) % Outlines the stoplight in yellow (14)
drawoval (300, 275, 20, 20 , 4) % Red light outline(4)
drawoval (300, 225, 20, 20 , 14) % Yellow light outline (14)
drawoval (300, 175, 20, 20 , 10) % Green light outline (10)
%Normal light sequence
loop
exit when hasch
drawfilloval (300, 175, 20, 20 , 10) % Green light fill (10)
delay (4000) % Wait 4 seconds
drawfilloval (300, 175, 20, 20 , 0) % Black light fill (0)
drawoval (300, 175, 20, 20 , 10) % Green light outline (10)
drawfilloval (300, 225, 20, 20 , 14) % Yellow light outline (14)
delay (4000) % Wait 4 seconds
drawfilloval (300, 225, 20, 20 , 0) % Black light fill (0)
drawoval (300, 225, 20, 20 , 14) % Yellow light outline (14)
drawfilloval (300, 275, 20, 20 , 4) % Red light fill (10)
delay (4000) % Wait 4 seconds
drawfilloval (300, 275, 20, 20 , 0) % Black light fill (0)
drawoval (300, 275, 20, 20 , 4) % Red light outline(10)
end loop
%I got this far but i need to make a 4 way stop wht should i do??? |