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

Username:   Password: 
 RegisterRegister   
 Simple Stop Light Animation
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
smith_scott_04




PostPosted: Sun Nov 16, 2003 10:38 pm   Post subject: Simple Stop Light Animation

Here is a simple stop light animation i made while i was bored.

code:


var colo : int := 0
var d : int := 50
var x, y : int
x := 300
y := 220
var boxx1 : int := 230
var boxy1 : int := 50
var boxx2 : int := 370
var boxy2 : int := 385

drawfilloval (x, y, d, d, colo)
drawbox (boxx1, boxy1, boxx2, boxy2, red)

loop

    for count : 1 .. 3

        if count = 1 then
            colo := green
            drawfilloval (x, y + 100, d, d, colo)
            delay (1000)
            cls
            drawbox (boxx1, boxy1, boxx2, boxy2, red)
        end if

        if count = 2 then
            colo := yellow
            drawfilloval (x, y, d, d, colo)
            delay (1000)
            cls
            drawbox (boxx1, boxy1, boxx2, boxy2, red)
        end if

        if count = 3 then
            colo := red
            drawfilloval (x, y - 100, d, d, colo)
            delay (1000)
            cls
            drawbox (boxx1, boxy1, boxx2, boxy2, red)
        end if
        delay (10)
    end for
end loop
Sponsor
Sponsor
Sponsor
sponsor
Thuged_Out_G




PostPosted: Thu Nov 20, 2003 5:24 pm   Post subject: (No subject)

i could be wrong...but isnt the green lught usually on the bottom, and the red on top? Confused
poly




PostPosted: Thu Nov 20, 2003 8:12 pm   Post subject: (No subject)

yeah... Thuged_Out_G is right, you have the lights reversed there
Andy




PostPosted: Fri Nov 21, 2003 7:15 pm   Post subject: (No subject)

somebody obviously failed their G1 test...
rizzix




PostPosted: Fri Nov 21, 2003 10:11 pm   Post subject: (No subject)

well he knows green is go right?
Andy




PostPosted: Sun Nov 23, 2003 4:06 pm   Post subject: (No subject)

lol, thats not where most ppl have trouble with, its red means stop that ppl dont understand. i noe two ppl, they both got hit from the rear cuz some old lady didnt brake on a red light.
nis




PostPosted: Sun Nov 30, 2003 5:22 pm   Post subject: (No subject)

Wow that was a lot of code for something so simple

code:

drawbox (0, 0, 150, 300, 7)
loop
    drawfilloval (75, 50, 40, 40, brightgreen)
    delay (500)
    drawfilloval (75, 50, 40, 40, 0)
    drawfilloval (75, 150, 40, 40, yellow)
    delay (500)
    drawfilloval (75, 150, 40, 40, 0)
    drawfilloval (75, 250, 40, 40, brightred)
    delay (500)
    drawfilloval (75, 250, 40, 40, 0)
end loop
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: