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

Username:   Password: 
 RegisterRegister   
 Rolling Dice
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
hossack




PostPosted: Thu Apr 09, 2009 9:56 am   Post subject: Rolling Dice

In order to animate dice rolling would I have to load 6 different pictures and put them in a loop and change one after the other? Or is there an easier way?
Sponsor
Sponsor
Sponsor
sponsor
DemonWasp




PostPosted: Thu Apr 09, 2009 10:11 am   Post subject: RE:Rolling Dice

A six-sided die can be shown from one side as a box and several dots (circles). You should be able to do this with Draw.FillOval and Draw.Box pretty easily.
Tallguy




PostPosted: Thu Apr 09, 2009 12:32 pm   Post subject: RE:Rolling Dice

then just rand.int the numbers 1 - 6 then display them in a box with dots as DemonWasp said
matt271




PostPosted: Thu Apr 09, 2009 2:57 pm   Post subject: Re: Rolling Dice

i think he wants to animate the action of the dice rolling
hossack




PostPosted: Tue Apr 14, 2009 8:47 am   Post subject: RE:Rolling Dice

Turing:
proc dice %Dice Rolling

    loop

        randint (die, 1, 6)
        randint (die2, 1 , 6)
        delay (100)
        count := count + 1

        if die = 1 then
            Pic.Draw (one, 580, 20, picCopy)

        elsif die = 2 then
            Pic.Draw (two, 580, 20, picCopy)

        elsif die = 3 then
            Pic.Draw (three, 580, 20, picCopy)

        elsif die = 4 then
            Pic.Draw (four, 580, 20, picCopy)

        elsif die = 5 then
            Pic.Draw (five, 580, 20, picCopy)

        elsif die = 6 then
            Pic.Draw (six, 580, 20, picCopy)
end if
           
            if die2 = 1 then

            Pic.Draw (one, 520, 20, picCopy)
        elsif die2 = 2 then

            Pic.Draw (two, 520, 20, picCopy)
        elsif die2 = 3 then

            Pic.Draw (three, 520, 20, picCopy)
        elsif die2 = 4 then

            Pic.Draw (four, 520, 20, picCopy)
        elsif die2 = 5 then

            Pic.Draw (five, 520, 20, picCopy)
        elsif die2 = 6 then

            Pic.Draw (six, 520, 20, picCopy)

        end if
        exit when count = 15
    end loop
end dice


I got it working Thanks
TokenHerbz




PostPosted: Wed Apr 15, 2009 2:59 am   Post subject: RE:Rolling Dice

eww picCopy
hossack




PostPosted: Wed Apr 15, 2009 8:49 am   Post subject: RE:Rolling Dice

What else am I supposed to use lol
Gackt




PostPosted: Wed Apr 15, 2009 9:11 am   Post subject: RE:Rolling Dice

If your concernced about a flippin picCopy command that is no different from the others, Put World of Warcraft away and get a life.
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  [ 8 Posts ]
Jump to:   


Style:  
Search: