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

Username:   Password: 
 RegisterRegister   
 traffic lights flash help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
sllipnot2




PostPosted: Thu Jun 07, 2007 7:13 pm   Post subject: traffic lights flash help

hey everybody
i need help, if someone is willing to help me plzzzzzzzzzzzzzzzzzzzzzzzzz for my traffic lights to flash as for normal , i shall show u the my code for the traffic
drawfillbox (321, 185, 392, 204, brown)
drawfillbox (390, 192, 398, 200, brown)
drawfilloval (329, 196, 7, 7, red)
drawfilloval (352,197, 7, 7, yellow)
drawfilloval (375,197, 7, 7, green)
plzzzzzzzzzzzzz help i am new at this program !
Sponsor
Sponsor
Sponsor
sponsor
Saad




PostPosted: Thu Jun 07, 2007 7:19 pm   Post subject: Re: traffic lights flash help

Basically what you need is a delay, the usage of delay is delay([time in miliseconds]), so after every light gets drawn i would add a delay(1000)
LaZ3R




PostPosted: Thu Jun 07, 2007 7:22 pm   Post subject: Re: traffic lights flash help

loop
drawfillbox (321, 185, 392, 204, brown)
drawfillbox (390, 192, 398, 200, brown)
drawfilloval (329, 196, 7, 7, red)
drawfilloval (352, 197, 7, 7, 68)
drawfilloval (375, 197, 7, 7, green)
drawfilloval (375, 197, 7, 7, brightgreen)
delay (1000)
drawfilloval (375, 197, 7, 7, green)
drawfilloval (352, 197, 7, 7, yellow)
delay (1000)
drawfilloval (352, 197, 7, 7, 68)
drawfilloval (375, 197, 7, 7, green)
drawfilloval (329, 196, 7, 7, brightred)
delay (1000)
end loop

It's terrible code but I'm studying for physics (even though I'm on compsci... :S) and I don't feel like thinking too hard Smile

You need to simply use delays for such a simple idea like this and a loop if you want to constantly run through the lights.
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  [ 3 Posts ]
Jump to:   


Style:  
Search: