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

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




PostPosted: Sat Dec 15, 2012 10:40 pm   Post subject: Animation with buttons

What is it you are trying to achieve?
i am trying to get my program to run my animation and my buttons to be shown at the same time without my buttons getting drawn over

Describe what you have tried to solve this problem
putting the buttons in different places in my code; above the fork and below

Turing:


for i : 1 .. 500
    yy (i) := Rand.Int (600, 1200) %generating the y-cordinate for each snowflake
    xx (i) := Rand.Int (0, maxx) %generating the x-cordinate for each snowflake
end for

process Snow
    View.Set ("offscreenonly")
    loop
        Title ()
        Draw.Fill (1, 1, 16, 124) %making the whole screen black except the letters
        Title ()
        for i : 1 .. 500
            snow (i) := Rand.Int (1, 10) %assigning the amount the snowflake falls by
            yy (i) := yy (i) - snow (i) %subtracting the amount the snowflake falls by (so that the snowflake falls)
            if yy (i) < 0 then %if the snowflake reached the bottom; reset the variable for the snowflake
                yy (i) := Rand.Int (600, 700) %reassigning the snowflakes the hit the bottom of the screen; back to the top
            end if
            Draw.FillOval (xx (i), yy (i), 1, 1, white) %drawing the snowflake
        end for
        View.Update
        delay (30)
    end loop
end Snow

fork PlayMusic
button := GUI.CreateButton (500, 240, 0, "INSTRUCTIONS", Instructions)     %button for the instructions
button := GUI.CreateButton (950, 40, 0, "TURN MUSIC OFF", EndMusic)  %button for ending the music
button := GUI.CreateButton (953, 70, 0, "TURN MUSIC ON", Play)     %button for playing the music
button := GUI.CreateButton (10, 70, 0, "COOL GUY", Cool)     %button for 'cool guy' character mode
button := GUI.CreateButton (25, 40, 0, "NERD", Nerd)     %button for 'nerd guy' character mode
button := GUI.CreateButton (500, 300, 0, "SINGLE PLAYER", Single)     %button for single player mode
button := GUI.CreateButton (505, 270, 0, "MULTIPLAYER", Multiplayer)     %button for multiplayer mode
fork Snow

loop
    exit when GUI.ProcessEvent
end loop



Please specify what version of Turing you are using
4.1
Sponsor
Sponsor
Sponsor
sponsor
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  [ 1 Posts ]
Jump to:   


Style:  
Search: