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

Username:   Password: 
 RegisterRegister   
 Lamp moving animation
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
bharath1000




PostPosted: Mon Dec 12, 2011 9:54 am   Post subject: Lamp moving animation

im trying to make this lamp move... but it keeps on disapering
i want this lamp to move left to right without disapeering as it is haunted =D .



Turing:

%lamp
drawline (500, 240, 500, 600, 7)
drawfilloval (500, 200, 40, 40, yellow)
drawoval (500, 200, 40, 40, 7)
%moving lamp
for a : 1 .. 100 by 5
    drawline (500 + a, 240 + a, 500 + a, 600 + a, 7)
    drawfilloval (500 + a, 200 + a, 40, 40, yellow)
    drawoval (500 + a, 200 + a, 40, 40, 7)
    delay (50)
    drawline (500 + a, 240 + a, 500 + a, 600 + a, white)
    drawfilloval (500 + a, 200 + a, 40, 40, white)
    drawoval (500 + a, 200 + a, 40, 40, white)
    delay (50)
end for
Sponsor
Sponsor
Sponsor
sponsor
mirhagk




PostPosted: Mon Dec 12, 2011 10:39 am   Post subject: RE:Lamp moving animation

I'm confused, your erasing it by drawing over it with white. The lamp should flash on and off with this code, you should look at how you have it structured:

draw lamp
wait 50 milliseconds
erase lamp
wait 50 milliseconds

How should that be changed?
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: