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.

Newcomers DBPro Corner / Keys, Keystates, etc.

Author
Message
Zero Blitzt
20
Years of Service
User Offline
Joined: 18th Jan 2004
Location: Different Stages
Posted: 3rd Mar 2004 04:33
How, in my program, could I get it so that when the player hits the escape key to quit, a small credits screen pops up first, before they leave. I attached code, it didnt work, although it wasnt in my main loop (if that made a difference). The attached code came after the main loop.

By the way, It was just a small little dumb insignificant game I made... its supposed to be a spoof on the PS2 game called "Big Rigs" which was a terrible game. If you want to play my game go to www.t4e0.4cybiko.com/BigRigsXtreme.zip . It's version 0.9.

http://www.t4e0.4cybiko.com
The GameXaero Forums
Saikoro
21
Years of Service
User Offline
Joined: 6th Oct 2003
Location: California
Posted: 3rd Mar 2004 04:45
well first of all I believe that keystate(1) is escape, what you have there is "C". Also, im not sure but i dont think that you are allowed to use keystate(1) anyway. Just put an in-game way to get out that way you could just slip the code in at the end. And if you want them to see the credits and disable the escape key way out, just use DISABLE ESCAPEKEY and make the in-game way out easy to access.

-Vash the Stampede

Intel Pentium 4 3.0 Ghz 1024MB Ram NVIDIA GeForceFX 5200 128MB 19" LCD DVI Viewsonic

Saikoro
21
Years of Service
User Offline
Joined: 6th Oct 2003
Location: California
Posted: 3rd Mar 2004 04:46
oh and by the way if you want all the keystates that I know of in a list, here it is:


-Vash the Stampede

Intel Pentium 4 3.0 Ghz 1024MB Ram NVIDIA GeForceFX 5200 128MB 19" LCD DVI Viewsonic

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 3rd Mar 2004 06:13
KEYSTATE
This command will return an integer value of one if the key specified by the scancode is pressed, otherwise
zero will be returned. The scancode value is the raw value assigned to the key of the keyboard device and
very often is ordered sequentially from the top left of the keyboard to the bottom right.

SYNTAX
Return Integer=KEYSTATE(Scancode)




hope this helps


-RUST-
"What the... Mooooooooooo!"
Flashing Blade
22
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 3rd Mar 2004 11:53 Edited at: 3rd Mar 2004 11:53
I think your problem is suspend for key so soon after key pressed

put something like this:

...

PRINT "Credits:"
Print ""
Print "Game Design: Testforechozero"
Print "Music: i burn things"
Print ""
Print "Thanks to LUE and (the original) Big Rigs!"
sync
repeat
until scancode()=0

suspend for key
end
endif
Zero Blitzt
20
Years of Service
User Offline
Joined: 18th Jan 2004
Location: Different Stages
Posted: 3rd Mar 2004 13:39
Still doesnt work, I attached the full source...

http://www.t4e0.4cybiko.com
The GameXaero Forums
Flashing Blade
22
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 3rd Mar 2004 16:19
your main loop never checks escapekey

try this:
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 4th Mar 2004 12:51
Could also try EXIT PROMPT "bye bye thanks for playing","game over" after escapekey is checked for.

In Space No One can Hear You Scream! (When your comm Line is cut?)

Login to post a reply

Server time is: 2024-11-26 07:44:16
Your offset time is: 2024-11-26 07:44:16