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.

Author
Message
Dmas_Zero
20
Years of Service
User Offline
Joined: 9th Feb 2004
Location:
Posted: 28th Feb 2004 22:44
theres a function that know if i press the key?
NOT if the key is already pressed like in "if upkey()=1 then"
if not how do i make one?
sponge008
20
Years of Service
User Offline
Joined: 8th Feb 2004
Location: MA, USA
Posted: 28th Feb 2004 22:47
inkey$() is the function you're looking for.
Tim Ballisto
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Right behind you.
Posted: 28th Feb 2004 22:52
it would be

if (inkey$())="k"
commands
endif

you can replace the k with almost any key

so (inkey$())="r"

etc.
Dmas_Zero
20
Years of Service
User Offline
Joined: 9th Feb 2004
Location:
Posted: 28th Feb 2004 23:33
no no i mean if there's any function that know if i only press a key (not if the key is down such as in inkey$ and upkey etc...)
in visual basic it's called key press, it's also have key down and key up.
Dmas_Zero
20
Years of Service
User Offline
Joined: 9th Feb 2004
Location:
Posted: 28th Feb 2004 23:34
what i'm trying to do is in my platform game when i press the up key the player will jump, but he will not jump again if i keep my finger on the key.
Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 28th Feb 2004 23:37
if upkey()=1 and jumpflag=0 then jumpflag=1 : do the jump
if jump=done then jumpflag=0


Quote: "
Amd 2500+ | 1024mb pc2700 | A7N8X-X | Geforce4 ti 4200 128mb
"
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 28th Feb 2004 23:43
i=1
do
if inkey()="k" then i=2
if i=2 then do something
inc time
if time=10 then i=1
loop

CURRENT PROJECT: RETRO PAC-MAN
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 28th Feb 2004 23:44
sorry you post first but I don't saw it

CURRENT PROJECT: RETRO PAC-MAN
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 29th Feb 2004 00:25
Quote: "in visual basic it's called key press, it's also have key down and key up."


In vb these are Events, raised by the the parent object. There is no equivalent in dbp for this in hte true sense but...

Quote: "if upkey()=1 and jumpflag=0 then jumpflag=1 : do the jump
if jump=done then jumpflag=0 "


is the logic you can use to mimic this

-RUST-
"What the... Mooooooooooo!"

Login to post a reply

Server time is: 2024-09-22 00:02:41
Your offset time is: 2024-09-22 00:02:41