press the key once

blursea
08-20-2001, 12:55 PM
i want to press the key G once and mario jumps once, how can i di that

orufet
08-20-2001, 04:31 PM
There are many different ways this can be acomplished. You can detect the KeyCode event for "G", and then have some code for the jump. It really depends on your situation

Jacob Sheehy
http://www.sheehy.ca

"Error, no keyboard — press F1 to continue."

TommyHM111
08-24-2001, 01:03 PM
blursea... come on. im not trying to be rude (because im not an expert myself) but still. i have given you the code to detect kpress events so many times.. all you have to do is modify it to detect the g event. we do give you alot of help at this forum but we can't write the whole thing (hope i didn't make too many people mad with my post)
Tommy

<font color=white>Scooby </font color=white> <font color=yellow>-Doo </font color=yellow><font color=blue> Where are you? </font color=blue>

BillSoo
08-24-2001, 01:10 PM
Hey TommyHM111,

Your post is not offensive but it doesn't really add to the thread either...you should probably send Private messages for something like this...

BTW: I'm posting this publicly rather than PMing you because I want to explain this to everybody; it's not just you.




"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder

TommyHM111
08-24-2001, 01:14 PM
yes i do agree that it should have been in a private message. Sorry, I don't take offense to what you said, and now after i realized that it didn't add to the thred but blursea the code is
in the keydown event
if keydown = vbkeyG then
'code for mario jumping
endif

<font color=white>Scooby </font color=white> <font color=yellow>-Doo </font color=yellow><font color=blue> Where are you? </font color=blue>

Squirm
08-24-2001, 04:07 PM
A good way to detect keypress is to have your main gaim in a loop with many booleans for a start:

bUp, bDown, bLeft, bRight

in the cub Form_KeyDown, detect the required keypress and set bUp to True. In the KeyUp sub, set it to false. In the main game loop, these Booleans are checked every loop (or infact you can have another boolean which states a change in keypress) and then movement based on that. Putting all your move code within the Form_Keypress event is a little sloppy. images/icons/smile.gif

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum