Here's probably a really easy one, but how do you get user input for pressing down two keys at once?
I thought it'd be by doing this:
> If user presses "SPACE BAR"
+ If user presses "UP ARROW"
But it doesn't work for me. I also tried to simultaneously press SPACE BAR and the UP ARROW when I was prompted as to which key should the event check on press to have it as a single event, but that didn't cut it either. I know that in VB different keys have different ASC codes that correspond with them (ex. the <ENTER> key = ASC code 13), does the solution have to do with their ASC codes?
I'm sure it's easy, but how do you do it?
Thanks!
--
"Del Duio has received 0 trophies. Click here to see them all."
"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"
DXF Games, coming next: Hasslevania 2- This Space for Rent!
Peblo Custom ratings must be 50 characters or less
Registered 05/07/2002
Points 185
5th February, 2006 at 13:09:08 -
Um, you could always try it:
> Repeat while user holds "SPACE BAR"
+ If user presses "UP ARROW"
Or:
>Always- Flag 0 off, Flag 1 off
>User presses Space- Flag 0 ON
>User presses Up- Flag 1 ON
>Flag 0 is on
+Flag 1 in on- Action
I believe that works, be careful on the order though.
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath
-----------------------------------
Always - Dummyobjecy.Flag0 & Flag1 turn OFF
Player Presses X - Dummyobject1.Flag0 turn ON
Player Presses C - Dummyobject1.Flag1 turn ON
Dummyobject.Flag0 = On && Dummyobject.Flag1 = On - Your event here.
===
Though the way Peblo said works as well. They way you've got it coded Del, the person would have to press both buttons in the exact same loop. That's press, not hold down.
The way I have it now, my guy can do an upward slash while he's jumping, but I also wanted to give the player the option to do the same attack while standing on the ground with space + up. I'll code this after work straightaway.
I don't believe I've ever used the repeat while key is down, but it all makes sense now, doh!
--
"Del Duio has received 0 trophies. Click here to see them all."
"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"
DXF Games, coming next: Hasslevania 2- This Space for Rent!