Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Need Help with my Stoplight program I got one light...
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
CrazyTiger




PostPosted: Mon Jan 09, 2006 7:41 pm   Post subject: Need Help with my Stoplight program I got one light...

code:
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???
Sponsor
Sponsor
Sponsor
sponsor
pavol




PostPosted: Mon Jan 09, 2006 7:56 pm   Post subject: (No subject)

duplicate your code for the stop light and change the x and y values so you see four of the lights. and then make them change however you want, one by one or a couple at a time.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: