Author |
Message |
harishmabish
|
Posted: Thu Apr 03, 2008 4:12 pm Post subject: Is there a command to freeze the screen completely? |
|
|
I'm to make a game where when its "game over", it freezes everything that's in the background?
Is there a command on Turing that does this? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Zampano
|
Posted: Thu Apr 03, 2008 4:25 pm Post subject: Re: Is there a command to freeze the screen completely? |
|
|
You should probably just make it so that the failure will cause the program to reach its end. This could be done by exiting the main loop. I don't know if there's any command that will cause the program to stop receiving any input and halt permanently, and even if there was, what you must do is reach the end.
You might want to look at:
It causes the run window to be destroyed though. |
|
|
|
|
|
Tony
|
Posted: Thu Apr 03, 2008 4:39 pm Post subject: RE:Is there a command to freeze the screen completely? |
|
|
jumping to the end of the code (so right out of your main game loop) and finishing execution should do the trick. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
BigBear
|
Posted: Thu Apr 03, 2008 4:48 pm Post subject: Re: Is there a command to freeze the screen completely? |
|
|
When you exit a loop and do not put cls (which clear the screen) then the program will remain frozen for the game over. Here is a simple program that will freeze when you get a game over (or press q) Use the arrow keys to move. Turing: |
var movement : string (1) := "" %holds the value of what key the user enters
var location_x : int := 0 %location of the square left and right (x axis)
var location_y : int := 0 %location of the square up and down (y axis)
%Starts program
loop
drawfillbox (100 + location_x, 100 + location_y, 200 + location_x, 200 + location_y, blue) %DRaws blue box where the user moves it
exit when movement = "q" or movement = "Q"%Freezes game when q is pressed
getch (movement ) %Asks for input from user
%Decides where the user moved the square
if movement = KEY_LEFT_ARROW then
location_x - = 1
elsif movement = KEY_RIGHT_ARROW then
location_x + = 1
elsif movement = KEY_UP_ARROW then
location_y + = 1
elsif movement = KEY_DOWN_ARROW then
location_y - = 1
end if
cls %clear the screen to move box without a tail
end loop
%Nothing is out side of the loop so program ends
/*Putting this at the end of the if statement would do the same thing
elsif movement = "q" then
return*/ |
If this isn't what you wanted then please provide more information. |
|
|
|
|
|
andrew.
|
Posted: Mon Apr 07, 2008 10:13 am Post subject: Re: Is there a command to freeze the screen completely? |
|
|
You can use "break" but then to continue the program you have to press resume at the top of the source code screen. |
|
|
|
|
|
Prince Pwn
|
Posted: Mon Apr 07, 2008 12:57 pm Post subject: RE:Is there a command to freeze the screen completely? |
|
|
Input.Pause, then you have to hit a key to resume. |
|
|
|
|
|
|