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

Username:   Password: 
 RegisterRegister   
 My tree looks like it's bleeding
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
DaBigOne




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
Raknarg




PostPosted: 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
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: