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

Username:   Password: 
 RegisterRegister   
 Animation problems NEED HELP- Turing
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Crzn




PostPosted: Sat Apr 29, 2017 10:35 pm   Post subject: Animation problems NEED HELP- Turing

Ok, so I'm a beginner in turing and need some help.

I am trying to make multiple animations happen at the same time but those animations start overlapping messing up one another.

I need help with the draw fill command since when I use it due to the other animations the fill leaks from my object in to the rest of program.

NEED HELP FAST


MY STILL PICTURE CODE: (THIS IS HOW THE PROGRAM SHOULD LOOK LIKE)

setscreen ("graphics:640;480")

%The sky
drawfillbox (0, 260, 640, 480, 104)

%the sun
drawfilloval (320, 260, 40, 40, 42)
drawarc (320, 260, 50,50, 0, 100, 42)
drawarc (320, 260, 57, 57, 30, 93, 42)
drawarc (320, 260, 46, 46, 110, 180,42)
drawarc (320, 260, 64, 64, 95, 173, 42 )
drawarc (320, 260, 73, 73, 10, 90, 42)
drawarc (320, 260, 84, 84, 66, 140,42)
drawarc (320, 260, 95,95, 10, 100, 42)
drawarc (320, 260, 110, 110, 30, 110,42)

%the stars
drawfillstar (20, 400, 40, 420, white)
drawfillstar (140, 440, 160, 460, white)
drawfillstar (620, 370, 640, 390, white)
drawfillstar (500, 370, 520, 390, white)
drawfillstar (40, 300, 60, 320, white)
drawfillstar (250, 380, 270, 400, white)
drawfillstar (430, 450, 450, 470,white)

drawline (0, 260, 640, 260, black)

%The sea area
drawfillbox (0,260, 640, 0, 55)

%The waves
var count : int
count := 25
for waves1 : 0 .. 12
drawarc (count + (waves1 * 50), 200, 50, 50, 60, 120, black) %the y value decreases for the waves to be beneath (200)
end for

for waves1 : 0 .. 12
drawarc (count + (waves1 * 50), 150, 50, 50, 60, 120, black) %the y value decreases for the waves to be beneath (150)
end for

for waves1 : 0 .. 12
drawarc (count + (waves1 * 50), 100, 50, 50, 60, 120, black) %the y value decreases for the waves to be beneath (100)
end for

for waves1 : 0 .. 12
drawarc (count + (waves1 * 50), 50, 50, 50, 60, 120, black) %the y value decreases for the waves to be beneath (50)
end for

for waves1 : 0 .. 12
drawarc (count + (waves1 * 50), 0, 50, 50, 60, 120, black) %the y value decreases for the waves to be beneath (50)
end for

%the land
drawfillbox (500, 0, 600, 70, red)
drawline (500,70,250,0,red)
drawline (600,70,730,0, red)
drawline (250,0 , 730,0 ,red)
drawfill (260, 2, red,red)
drawfill (605,65,red,red)

%the tree
drawfillbox (500,30, 600,200, 137)

%the leaves
drawfilloval (550, 300, 100, 150, green)

%the birdie
drawline (130,300, 150, 400, grey) %Back wing
drawline (230, 300, 150, 400, grey)
drawline (130, 300, 260, 300, grey)
drawfill (137, 310, grey, grey)

drawfillarc (190, 290, 100, 33, 0, 360, red ) %body
drawfillarc (190, 263, 70, 5, 0, 360, grey)

drawfillarc (110,265,70,40,90,190,red) % head

drawfilloval (80,285,6,6,yellow) %eye
drawfilloval (78, 285,3,3,black)

drawarc (40,245,25,25,90,180,yellow) %beak
drawline (55, 260, 15, 247,yellow)
drawline (55, 260, 40, 269, yellow)
drawfill (40, 261,yellow, yellow)

drawline (130, 300, 300, 400, grey) %Front wing
drawline (260, 300, 300, 400, grey)
drawline (130, 300, 260, 300, grey)
drawfill (257, 305, grey, grey)










With Animations (i havnt added the bird into it yet) code: (THIS IS HOW IT IS RIGHT NOW)

setscreen ("graphics:640;480")


process waves
var count : int
count := 25

%wavees are stationary

loop
drawfillbox (0, 260, 640, 0, 55)
for waves1 : 0 .. 12
drawarc (count + (waves1 * 50), 200, 50, 50, 60, 120, black) %the y value decreases for the waves to be beneath (200)
end for

for waves1 : 0 .. 12
drawarc (count + (waves1 * 50), 150, 50, 50, 60, 120, black) %the y value decreases for the waves to be beneath (150)
end for

for waves1 : 0 .. 12
drawarc (count + (waves1 * 50), 100, 50, 50, 60, 120, black) %the y value decreases for the waves to be beneath (100)
end for

for waves1 : 0 .. 12
drawarc (count + (waves1 * 50), 50, 50, 50, 60, 120, black) %the y value decreases for the waves to be beneath (50)
end for

for waves1 : 0 .. 12
drawarc (count + (waves1 * 50), 0, 50, 50, 60, 120, black) %the y value decreases for the waves to be beneath (50)
end for

delay (600)

%goes down
drawfillbox (0, 260, 640, 0, 55)
for waves1 : 0 .. 12
drawarc (count + (waves1 * 50), 190, 50, 50, 60, 120, black) %the y value decreases for the waves to be beneath (200)
end for

for waves1 : 0 .. 12
drawarc (count + (waves1 * 50), 140, 50, 50, 60, 120, black) %the y value decreases for the waves to be beneath (150)
end for

for waves1 : 0 .. 12
drawarc (count + (waves1 * 50), 90, 50, 50, 60, 120, black) %the y value decreases for the waves to be beneath (100)
end for

for waves1 : 0 .. 12
drawarc (count + (waves1 * 50), 40, 50, 50, 60, 120, black) %the y value decreases for the waves to be beneath (50)
end for

for waves1 : 0 .. 12
drawarc (count + (waves1 * 50), -10, 50, 50, 60, 120, black) %the y value decreases for the waves to be beneath (50)
end for

delay (600)
%goes up

drawfillbox (0, 260, 640, 0, 55)
for waves1 : 0 .. 12
drawarc (count + (waves1 * 50), 180, 50, 50, 60, 120, black) %the y value decreases for the waves to be beneath (200)
end for

for waves1 : 0 .. 12
drawarc (count + (waves1 * 50), 130, 50, 50, 60, 120, black) %the y value decreases for the waves to be beneath (150)
end for

for waves1 : 0 .. 12
drawarc (count + (waves1 * 50), 80, 50, 50, 60, 120, black) %the y value decreases for the waves to be beneath (100)
end for

for waves1 : 0 .. 12
drawarc (count + (waves1 * 50), 30, 50, 50, 60, 120, black) %the y value decreases for the waves to be beneath (50)
end for

for waves1 : 0 .. 12
drawarc (count + (waves1 * 50), -20, 50, 50, 60, 120, black) %the y value decreases for the waves to be beneath (50)
end for

delay (600)

end loop

end waves

process sun

drawfilloval (320, 260, 40, 40, 42)
drawarc (320, 260, 50, 50, 0, 100, 42)
drawarc (320, 260, 57, 57, 30, 93, 42)
drawarc (320, 260, 46, 46, 110, 180, 42)
drawarc (320, 260, 64, 64, 95, 173, 42)
drawarc (320, 260, 73, 73, 10, 90, 42)
drawarc (320, 260, 84, 84, 66, 140, 42)
drawarc (320, 260, 95, 95, 10, 100, 42)
drawarc (320, 260, 110, 110, 30, 110, 42)

end sun

process sky
drawfillbox (0, 260, 640, 480, 104)
end sky

process stars

drawfillstar (20, 400, 40, 420, white)
drawfillstar (140, 440, 160, 460, white)
drawfillstar (620, 370, 640, 390, white)
drawfillstar (500, 370, 520, 390, white)
drawfillstar (40, 300, 60, 320, white)
drawfillstar (250, 380, 270, 400, white)
drawfillstar (430, 450, 450, 470, white)

drawline (0, 260, 640, 260, black)

end stars

process land
loop
drawfillbox (500, 0, 600, 29, red)
drawline (500, 70, 250, 0, red)
drawline (600, 70, 730, 0, red)
drawline (250, 0, 730, 0, red)
drawline (499, 70, 499, 0, red)
drawline (601, 70, 601, 0, red)
drawfill (260, 2, red, red)
drawfill (605, 65, red, red)
end loop

end land

process tree

loop

drawfilloval (550, 300, 100, 150, green)
drawfillbox (500, 30, 600, 150, 137)

end loop

end tree

fork sky
fork stars
fork sun
fork waves
fork land
fork tree
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Sun Apr 30, 2017 6:58 pm   Post subject: RE:Animation problems NEED HELP- Turing

Processes are bad news. They are the cause of your problem, and you cannot fix it without eliminating them from the code entirely.

Fortunately, this is a common problem, and if you search through the Turing Help forum (which, by the way, is where you should have posted this) for doing two animations at the same time, you'll find tons of help.
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: