Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

3 Dimensional Chat / Do Ny1 here know how to pause the game??

Years of Service
User Offline
Joined: 22nd Dec 2002
Location: Norway
Posted: 30th Dec 2002 19:15
Hey!! I dunno how to pause the game..
heres what i wrote:

i thought this would happen:
if i press "P" the text appears, and the game pauses
until a key is pressed..


this is what happens:

the game starts, i press "P" (25)
the text pops up and dissapears,
the game continues as normal,
nothing more happens,
i get mad,
i jump around,
i wounder how i shall do this,
and now i'm here...

so, i woundered.. Do u know how 2 do this?
excuse my english i may not be the best 2 spell....correct..
Megaman X
Years of Service
User Offline
Joined: 21st Oct 2002
Location: Sweden
Posted: 30th Dec 2002 20:43
Well, I could not see ur coding all thanks to this forum being unable to use the snippet button in a non IX brower ( when will the guys fix it... ).

well, I wrote this for u... I dunno if works, I cannot test right now and I've not been coding for like 6 months in DB
the code may be crap and u will maybe need to set a flag later...but if even do not compiled u will get the idea. The idea of "Pause" a game is basicaly create a loop outside ur main loop. If the key P is pressed inside the main loop, will take you to another loop where nothing will happens... and will be ended when a condition is reached ( like P is pressed again u unpause ur game ). try this:

rem How to pause a game
rem by Rogue
rem make a matrix

make matrix 1,10000.0,10000.0,25,25
randomize matrix 1,50.0

rem position camera
position camera 5000,200,5000

rem main loop

rem Control camera with arrow keys
if leftkey()=1 then angley#=wrapvalue(angley#-2.0)
if rightkey()=1 then angley#=wrapvalue(angley#+2.0)

rem pause the game

if inkey$()="p" then gosub pause

rem Update camera
rotate camera 0,angley#,0

rem End loop



center text 320,240,"Game Paused"
if inkey$()="p" then return


I don't suffer from insanity, I enjoy every minute of it!"
-- Rogue

Login to post a reply

Server time is: 2023-05-30 21:34:01
Your offset time is: 2023-05-30 21:34:01