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

Username:   Password: 
 RegisterRegister   
 Pause and Continueing a Game
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
fear01




PostPosted: Tue Nov 22, 2005 5:47 pm   Post subject: Pause and Continueing a Game

I have just started using turing this semester and was wondering how I could pause game motion and then continue it with two different keys. I am using the Input.Keydown command and using the keys "p" and "c" to do it, uh could anyone help out a newbie with this problem? I have tried using commands like delay and pause, but no luck. Any help would be great. Thanks.
Sponsor
Sponsor
Sponsor
sponsor
Mystify




PostPosted: Tue Nov 22, 2005 5:51 pm   Post subject: (No subject)

Are you trying to pause the whole thing or just something like a timer?
person




PostPosted: Tue Nov 22, 2005 6:06 pm   Post subject: (No subject)

code:

var chars : array char of boolean
loop
    Input.KeyDown (chars)
    if chars ('p') then
        loop
            Input.KeyDown (chars)
            drawfilloval (Rand.Int (1, 1000), Rand.Int (1, 1000), 3, 3, 1)
            exit when chars ('c')
        end loop
    end if
end loop
Mystify




PostPosted: Tue Nov 22, 2005 6:12 pm   Post subject: (No subject)

There you go Very Happy
fear01




PostPosted: Tue Nov 22, 2005 9:07 pm   Post subject: (No subject)

Thank you Mystify, it worked and I'm done! Now i have time to do nothing. I would hug you but your there and i'm here, so just a simple text of "thank you".
fear01




PostPosted: Tue Nov 22, 2005 9:13 pm   Post subject: (No subject)

Ack! Sorry, i glanced at the code and didn't see the author, i would like to thank you too, uh "person". "HUGS" and "KISSES"!!!
The_Triangle




PostPosted: Thu Nov 24, 2005 4:15 pm   Post subject: (No subject)

fear01 wrote:
Ack! Sorry, i glanced at the code and didn't see the author, i would like to thank you too, uh "person". "HUGS" and "KISSES"!!!


watch yerself there bud


uh anyone know what the char of boolean for spacebar is ?

i tried KEY_SPACE, didnt do much.
person




PostPosted: Thu Nov 24, 2005 7:00 pm   Post subject: (No subject)

32
Sponsor
Sponsor
Sponsor
sponsor
GlobeTrotter




PostPosted: Thu Nov 24, 2005 7:15 pm   Post subject: (No subject)

The_Triangle wrote:
fear01 wrote:
Ack! Sorry, i glanced at the code and didn't see the author, i would like to thank you too, uh "person". "HUGS" and "KISSES"!!!


watch yerself there bud


uh anyone know what the char of boolean for spacebar is ?

i tried KEY_SPACE, didnt do much.


(' ')

should do it. Similarly, for a letter it's
('a')
('z')
codemage




PostPosted: Fri Nov 25, 2005 9:03 am   Post subject: (No subject)

If you need to know what the code for a specific key is, run KeyDown1.t in the examples/fun directory of Turing.
r0ssar00




PostPosted: Fri Nov 25, 2005 2:48 pm   Post subject: (No subject)

you could also look up an ascii table on the inet, theres so many, and i just find the one at the top of search results the most useful. turing uses this table, so just save it to your desktop or something. its invaluable to have.
person




PostPosted: Fri Nov 25, 2005 6:52 pm   Post subject: (No subject)

Quote:
32


i already posted the chr
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  [ 12 Posts ]
Jump to:   


Style:  
Search: