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

Username:   Password: 
 RegisterRegister   
 Animation timing help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
dabomb6




PostPosted: Fri Dec 21, 2007 5:53 pm   Post subject: Animation timing help

Hey im in a real hurry right now and im almost done this thing. my problem is i can get the smoke (near bottom) to come on and stay on during the wheels spinning(spoke animation) please help! and also, the maple leaf isnt high in my priorities but if i can get that to start and stay on at the same time as everythign else that would be nice.
thanks!

code:



setscreen("graphics")


drawfillstar (380,380,405,395,yellow)

%road colour could get the colour to work.
%drawdot (50,10,black)
%drawfill (50,11,18,black)
%buildings
drawline (0, 295, 70, 300, black)
drawline (70, 190, 70, 345, black)
drawline (70, 345, 130, 350, black)
drawline (130, 350, 130, 365, black)
drawline (130, 365, 230, 370, black)
drawline (230, 370, 300, 360, black)
drawline (290, 360, 290, 370, black)
drawline (290, 370, 370, 370, black)
drawline (370, 370, 390, 360, black)
drawline (390, 360, 390, 220, black)
drawline (370, 370, 370, 215, black)
drawline (300, 360, 300, 330, black)
drawline (300, 330, 300, 205, black)
drawline (230, 370, 230, 215, black)
drawline (130, 350, 130, 185, black)
%below is line furthast to the right
drawline (410, 350, 410, 225, black)
drawline (410, 350, 390, 350,black)
drawline (410, 350, 480, 340,black)
drawline (480, 246, 480, 340,black)

%road lines
drawline (305,195,500,253,black)
drawline (500,253,620,350,black)
drawline (500,235,620,340,black)
drawline (500,235, 375,195,black)
%drawfill (505,245,grey, black)

drawline (0,100,31,118,black)
drawline (0,75,35,100,black)

%curb at bottom rigth corner
drawline (480, 90, 480, 110, black)
drawline (620, 0, 480, 90, black)
drawline (620, 40, 480, 110, black)

drawline (480, 110, 620, 180, black)

%border
drawline (0, 0, 0, 460, black)
drawline (620, 0, 620, 460, black)
drawline (0, 0, 620, 0, black)
drawline (0, 400, 620,400,black)
%sky colour
drawfill (350,374,16,black)

%Burnout audio
process music
Music.PlayFile ("E:/burnout.mp3")
end music
fork music




%%%%%%%%%%Car body
drawline (198, 30, 392, 80, black)
drawline (198, 30, 188, 40, black)%grey
drawline (126, 20, 40, 80, black)
drawline (110, 80, 30, 120, black)
drawline (110, 80, 126, 20, black)
drawline (30, 120, 40, 80, black)
drawline (30, 120, 50, 160, black)
drawline (145, 125, 50, 160, black)
drawline (145, 125, 125, 170, black)%spoiler
drawline (175, 130, 155, 175, black)%spoiler
drawline (125, 170, 40, 190, black)%spoiler
drawline (125, 170, 155, 175, black) %spoiler
drawline (110, 80, 145, 125, black)
drawline (50, 160, 40, 190, black)
drawline (80, 190, 40, 190, black)
drawline (80, 190, 90, 160, black)
drawline (50, 160, 90, 160, black)
drawline (175, 130, 90, 160, black)
drawline (175, 130, 145, 125, black)
drawline (80, 190, 155, 175, black)
drawline (170, 210, 90, 160, black)
drawline (175, 130, 220, 205, black)
drawline (170, 210, 220, 205, black)
drawline (170, 210, 260, 220, black)
drawline (290, 215, 220, 205, black)
drawline (290, 215, 260, 220, black)
drawline (290, 215, 330, 170, black)
drawline (420, 190, 330, 170, black)

drawline (420, 190, 455, 150, black)

drawline (420, 190, 350, 200, black)
drawline (310, 195, 350, 200, black)



% troubleshooting: test line to determin if the front has the leak or rear has leak
%the one below cuts off front
%drawline (330, 170, 392, 80, black)
%the one below cuts off back
%drawline (330, 170, 200, 40, black)
%it was the rear bottom wheel well
 



%rear wheel arc
drawarc (160, 50, 40, 60, -20, 210, black)


%front wheel arc
drawarc (426, 110, 40, 60, 40, 212, black)
drawline (445,150, 457, 149, black)
drawdot (383,125,black)


%%%%%%%%%rear wheel
drawoval (160, 50, 30, 50, black)
drawoval (158, 50, 25, 45, black)
drawline (155, 0, 118, 20, black)
drawline (118, 25, 118, 20, black)
drawline (165, 97, 142, 105, black)
%hub
drawoval (160, 50, 5, 8, black)
drawoval (160, 50, 2, 3, black)

%%%%%%%%%%front wheel
drawoval (420, 120, 40, 40, black)
drawoval (420, 120, 35, 35, black)
%Hub
drawoval (420, 120, 7, 7, black)
drawoval (420, 120, 2, 2, black)
%drawdot (425,165,black)
drawfill (425,164,17, black)

%car colour
%tire colour
drawfill (143,88,black,black)%rear
drawfill (144,100,black,black)%rear
drawfill (174,100,17,black) %wheel well
drawfill (392,95,black,black)%front
drawfill (383,126,4,black)%wheel well
%roof
drawfill (250,216,4,black)
%side
drawfill (201,150,4,black)
%rear window area
drawfill (176,150,4,black)
drawfill (125,160,4,black)
drawfill (120,145,4,black)
%spoiler
drawfill (80,171,4,black)
drawfill (90,185,4,black)
drawfill (80,185,4,black)
drawfill (140,161,4,black)
drawfill (143,138,4,black)
drawfill (144,175,4,black)
%drawfill (161,150,4,black)
%hood
drawfill (340,191,4,black)
%rear bumper
drawfill (100,105,4,black)
drawfill (100, 80,4,black)


%rear spokes (not animated)
drawline (133,50, 155, 50,black)
drawline (133,20, 157, 43,black)

drawline (153,100, 158,58,black)
drawline (180, 88, 165, 55,black)

drawline (180, 35, 165, 45, black)
drawline (165, 7, 162, 42, black)


%star
drawfillstar (380,370,405,395,yellow)




%spokes
for i:1..1%38
drawline (450, 100, 425, 115, black)
drawline (430, 88, 421, 113, black)
drawline (387, 110, 413, 118, black)
drawline (387, 110, 413, 118, black)
drawline (390, 135, 413, 125, black)
drawline (425, 155, 420, 127, black)
drawline (448, 140, 427, 125, black)
delay(50)
drawline (450, 100, 425, 115, white)
drawline (430, 88, 421, 113, white)
drawline (387, 110, 413, 118, white)
drawline (387, 110, 413, 118, white)
drawline (390, 135, 413, 125, white)
drawline (425, 155, 420, 127, white)
drawline (448, 140, 427, 125, white)
delay(50)
%spokes moved
drawline (435, 90, 423, 113, black)
drawline (410, 88, 417, 113, black)
drawline (387, 125, 412, 122, black)
drawline (407, 152, 416, 127, black)
drawline (445, 145, 426, 126, black)
drawline (455, 117, 427, 118, black)
delay (50)
drawline (435, 90, 423, 113, white)
drawline (410, 88, 417, 113, white)
drawline (387, 125, 412, 122, white)
drawline (407, 152, 416, 127, white)
drawline (445, 145, 426, 126, white)
drawline (455, 117, 427, 118, white)
delay (50)
drawline (450, 100, 425, 115, black)
drawline (430, 88, 421, 113, black)
drawline (387, 110, 413, 118, black)
drawline (387, 110, 413, 118, black)
drawline (390, 135, 413, 125, black)
drawline (425, 155, 420, 127, black)
drawline (448, 140, 427, 125, black)
end for


%smoke from front tire burn out
drawfilloval (420,95,20,20,grey)
delay (400)
drawfilloval (400,120,20,20,grey)
delay (400)
drawfilloval (400,146,15,20,grey)
delay (400)
drawfilloval (380,100,20,20,grey)
delay (400)
drawfilloval (380,140,20,20,grey)
delay (400)
drawfilloval (380,160,20,20,grey)
delay (400)
drawfilloval (360,80,20,20,grey)
delay (400)
drawfilloval (360,80,20,20,grey)
delay (400)
drawfilloval (365,120,20,20,grey)
delay (400)
drawfilloval (360,150,20,20,grey)
delay (400)
drawfilloval (360,80,20,20,grey)
delay (400)
drawfilloval (350,169,15,20,grey)
delay (400)
drawfilloval (340,149,15,20,grey)
delay (400)
drawfilloval (350,100,15,20,grey)
delay (400)
drawfilloval (335,90,15,20,grey)
delay (400)
drawfilloval (335,70,15,20,grey)
delay (400)
drawfilloval (336,120,15,20,grey)
delay (400)
drawfilloval (325,140,15,20,grey)
delay (400)
drawfilloval (335,170,15,20,grey)
delay (400)
drawfilloval (315,70,15,20,grey)
delay (400)
drawfilloval (305,90,15,20,grey)
delay (400)
drawfilloval (315,110,15,20,grey)
delay (400)
drawfilloval (300,105,15,20,grey)
delay (400)
drawfilloval (300,125,15,20,grey)
delay (400)
drawfilloval (300,145,15,20,grey)
delay (400)
drawfilloval (310,155,15,20,grey)
delay (400)
drawfilloval (310,165,15,20,grey)
delay (400)
drawfilloval (310,180,15,20,grey)
delay (400)
drawfilloval (290,80,15,20,grey)
delay (400)
drawfilloval (290,70,15,20,grey)
delay (400)
drawfilloval (285,60,15,20,grey)
delay (400)
drawfilloval (280,80,15,20,grey)
delay (400)
drawfilloval (275,110,15,20,grey)
delay (400)
drawfilloval (290,140,15,20,grey)
delay (400)
drawfilloval (260,100,15,20,grey)
delay (400)
drawfilloval (265,130,15,20,grey)
delay (400)
drawfilloval (265,160,15,20,grey)
delay (400)
drawfilloval (280,160,15,20,grey)
delay (400)
drawfilloval (285,180,15,20,grey)
delay (400)
drawfilloval (285,195,15,20,grey)
delay (400)
drawfilloval (280,205,15,20,grey)
delay (400)
drawfilloval (280,215,15,20,grey)
delay (400)
drawfilloval (270,215,15,20,grey)
delay (400)
drawfilloval (260,190,15,20,grey)
delay (400)
drawfilloval (255,155,15,20,grey)
delay (400)
drawfilloval (255,105,15,20,grey)
delay (400)
drawfilloval (240,145,15,20,grey)
delay (400)
drawfilloval (240,125,15,20,grey)
delay (400)
drawfilloval (235,110,15,20,grey)
delay (400)
drawfilloval (255,80,15,20,grey)
delay (400)
drawfilloval (260,60,15,20,grey)
delay (400)
drawfilloval (255,40,15,20,grey)
delay (400)
drawfilloval (240,85,15,20,grey)
delay (400)
drawfilloval (240,55,15,20,grey)








%blue mapleleaf animation

for n:1..1%38
drawmapleleaf (150,220,200,350,blue)
delay (200)
drawfillmapleleaf (150,220,200,350,blue)
delay (200)
drawfillmapleleaf (150,220,200,350,white)
drawmapleleaf (150,220,200,350,blue)
end for
Sponsor
Sponsor
Sponsor
sponsor
Sean




PostPosted: Fri Dec 21, 2007 6:11 pm   Post subject: Re: Animation timing help

From Front Tire Burn Out, I suggest doing what you want in a for loop to tidy up all the drawline functions you have.
dabomb6




PostPosted: Fri Dec 21, 2007 6:37 pm   Post subject: RE:Animation timing help

doesnt help me with timing though. please i still need help!
dabomb6




PostPosted: Fri Dec 21, 2007 9:40 pm   Post subject: RE:Animation timing help

i really need some help. please!
syntax_error




PostPosted: Fri Dec 21, 2007 10:21 pm   Post subject: Re: Animation timing help

well as you said your problem was trouble running 2 times at the same time
this maybe a bad idea but make your animations into a proc
and then fork them so that you can run both together at the same time
hope that answers your concerns
any other questions ask
HeavenAgain




PostPosted: Fri Dec 21, 2007 10:22 pm   Post subject: RE:Animation timing help

ok for your maple leaf.... just draw it at the beginning of your code since you are not clearning the screen or anything, it'll always bethere
and for the tire spinning
change everything from
code:
%spokes
......
end for

into
code:
%spokes
process iDontKnow
loop
drawline (450, 100, 425, 115, black)
drawline (430, 88, 421, 113, black)
drawline (387, 110, 413, 118, black)
drawline (387, 110, 413, 118, black)
drawline (390, 135, 413, 125, black)
drawline (425, 155, 420, 127, black)
drawline (448, 140, 427, 125, black)
delay(50)
drawline (450, 100, 425, 115, white)
drawline (430, 88, 421, 113, white)
drawline (387, 110, 413, 118, white)
drawline (387, 110, 413, 118, white)
drawline (390, 135, 413, 125, white)
drawline (425, 155, 420, 127, white)
drawline (448, 140, 427, 125, white)
delay(50)
%spokes moved
drawline (435, 90, 423, 113, black)
drawline (410, 88, 417, 113, black)
drawline (387, 125, 412, 122, black)
drawline (407, 152, 416, 127, black)
drawline (445, 145, 426, 126, black)
drawline (455, 117, 427, 118, black)
delay (50)
drawline (435, 90, 423, 113, white)
drawline (410, 88, 417, 113, white)
drawline (387, 125, 412, 122, white)
drawline (407, 152, 416, 127, white)
drawline (445, 145, 426, 126, white)
drawline (455, 117, 427, 118, white)
delay (50)
drawline (450, 100, 425, 115, black)
drawline (430, 88, 421, 113, black)
drawline (387, 110, 413, 118, black)
drawline (387, 110, 413, 118, black)
drawline (390, 135, 413, 125, black)
drawline (425, 155, 420, 127, black)
drawline (448, 140, 427, 125, black)
end loop
end iDontKnow
fork iDontKnow

and hey, do you know how does a for loop work? if you dont.... i mean, you are using it........... for n: 1..1 %38? what does that mean? you are only running this for loop 1 time, whats the point of having it then?
you should ask your teacher for some help.
and i am sorry for using process....... but i'm sorry i cant help it, its the easiest way to solve your problem even if it is the wrong way (which it is)
Sean




PostPosted: Sat Dec 22, 2007 11:54 am   Post subject: Re: Animation timing help

First off, procedure and for loops will tidy it up and get what you want. Also, please, please, shorten the code, it can be alot easier with for loops, will cut down alot.
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  [ 7 Posts ]
Jump to:   


Style:  
Search: