My tree looks like it's bleeding
Author |
Message |
DaBigOne
|
Posted: Sat Oct 19, 2013 8:39 pm Post subject: My tree looks like it's bleeding |
|
|
What is it you are trying to achieve?
I'm trying to make the apple fall down from the tree.
What is the problem you are having?
When the apple falls, you need to remove the background behind, but there are two background colors to remove
Describe what you have tried to solve this problem
I've tried putting two backgrounds, and one to come in at a certain time, but I can't set multiple delays in one for loop, which means I have to wait for the apple to reach the ground first before erasing the green background.
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Turing: |
proc background
for a : 0 .. 640
%sky
drawbox (a, 0, 640, 400, blue)
%ground
drawbox (a, 0, 640, 50, green)
end for
end background
proc tree
%trunk
for a : 51 .. 150
drawbox (295, a, 355, 150, 4)
end for
%body
for a : 0 .. 100
drawoval (325, 225, a, a + 30, green)
drawoval (325, 225, a - 1, a + 30, green)
end for
%apples
for a : 0 .. 10
drawoval (320, 200, a, a, red)
drawoval (300, 150, a, a, red)
drawoval (400, 275, a, a, red)
drawoval (250, 270, a, a, red)
drawoval (330, 300, a, a, red)
drawoval (380, 140, a, a, red)
drawoval (360, 250, a, a, red)
drawoval (280, 220, a, a, red)
drawoval (355, 180, a, a, red)
delay (100)
end for
end tree
proc fallingApple
for decreasing a : 270 .. 61
%erase apple
drawoval (250, a + 1, 10, 10, green)
%draw apple
drawfilloval (250, a, 10, 10, red)
delay (5)
end for
end fallingApple
background
tree
fallingApple
|
Please specify what version of Turing you are using
4.11 |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Raknarg
![](http://compsci.ca/v3/uploads/user_avatars/3745510004d8be6689b92f.jpg)
|
Posted: Sat Oct 19, 2013 8:42 pm Post subject: RE:My tree looks like it\'s bleeding |
|
|
You need to draw them all at the same time. That way stuff like this is much easier to manipulate |
|
|
|
|
![](images/spacer.gif) |
|
|