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

Username:   Password: 
 RegisterRegister   
 Need Help with Putting Pause in Game...
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Ryft




PostPosted: Tue Jun 07, 2005 2:48 pm   Post subject: Need Help with Putting Pause in Game...

How would I go about doing this? I tried just doing a simple:

code:

if chars ('p') then
    Input.Pause
end if


This doesn't seem to work if I repress the same key however. So I'm wondering how I would make a pause that would be activated and deactivated with the same key? Thx.
Sponsor
Sponsor
Sponsor
sponsor
[Gandalf]




PostPosted: Tue Jun 07, 2005 3:11 pm   Post subject: (No subject)

Make a boolean statement that says whether or not the key is pressed:
Turing:
var ppressed : boolean := false
var chars : array char of boolean
Input.KeyDown (chars)
loop
    if chars ('p') then
        if ppressed = false then
            ppressed := true
            Input.Pause
        elsif ppressed = true then
            ppressed := false
        end if
    end if
end loop

That should work.
Bacchus




PostPosted: Tue Jun 07, 2005 9:36 pm   Post subject: (No subject)

Oooor
code:

var chars:array char of boolean

loop %Your main loop

%Your other stuff

   Input.KeyDown(chars)
   if chars('p') then
      loop
         Input.KeyDown(chars)
         if chars('p') then
            exit
         end if
      end loop
   end if
end loop
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  [ 3 Posts ]
Jump to:   


Style:  
Search: