 |
 |

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

08-20-2001, 04:31 PM
|
 |
Paranoid Coder
Retired Leader
|
|
Join Date: Mar 2001
Location: Canada
Posts: 2,716
|
|
Re: press the key once
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."
|
|

08-24-2001, 01:03 PM
|
|
|
Re: press the key once
|
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>
|
|

08-24-2001, 01:10 PM
|
 |
Code Meister
Retired Moderator * Guru *
|
|
Join Date: Aug 2000
Location: Vancouver, BC, Canada
Posts: 10,441
|
|
Re: press the key once
|
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
|
__________________
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
|

08-24-2001, 01:14 PM
|
|
|
Re: press the key once
|
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>
|
|

08-24-2001, 04:07 PM
|
 |
Political Coder
Retired Moderator * Guru *
|
|
Join Date: Mar 2001
Location: London, England
Posts: 8,037
|
|
Re: press the key once
|
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. [img]images/icons/smile.gif[/img]
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
 |
|