The Daily Click ::. Forums ::. Klik Coding Help ::. Amazing discovery? MMF2 reads keypresses for joystick events when no joystick's available?
 

Post Reply  Post Oekaki 
 

Posted By Message

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
23rd December, 2009 at 15:47:58 -

This is friggin' awesome!

My buddy kevinski told me to get rid of the "joystick only" splash screen for ODW because it works with a keyboard. I just tried it and it's true!

Now all of my player control events are set up to read joystick states and joystick button presses but if a joystick's not available it must somehow then start reading keypresses and make it work that way. And on every frame the player control has been set up for joystick only too!!

In light of this, my game will now feature keyboard support!

I see that the arrow keys move the guys around, and that shift and cntrl are for the melee and gun attacks. The only keypresses I can't figure out are whatever controls joystick buttons 3 & 4 but that's no biggie. I can just code those events for keyboard separately if I have to. The bulk of the engine works off of the joystick and buttons 1 & 2 anyway.

Am I the world's biggest n00b? Set your game to only accept joystick controls, make events that only ask for joystick moves and button presses, don't hook up a joystick and it takes keyboard controls? Did anybody else know MMF2 did this?

Edited by Del Duio

 
--

"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!

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
23rd December, 2009 at 15:52:48 -

Yes, it's been standard practice to use the joystick object instead of the keyboard so players (or programmer) can easily remap the controls for some time now. I'm pretty sure KNP did the same thing.

By default, Spacebar and Enter are buttons 3 and 4. You can change them in the application's runtime options menu.

Edited by OMC

 

  		
  		

Silveraura

God's God

Registered
  08/08/2002
Points
  6747

Game of the Week WinnerKlikCast StarAlien In Training!VIP Member360 OwnerWii OwnerSonic SpeedThe Cake is a LieComputerChristmas Tree!
I am an April Fool
23rd December, 2009 at 16:40:27 -

My default, if you hit Ctrl + Y while the game is running, you can remap them during runtime. (Finishing what OMC started.)

But yeah, It's actually recommended you use the player controls rather than hard programing keys in. It's like using variables instead of solid values. Provides a lot more flexibility for the game to be changed with as little reproduction or repair as possible. Efficiency ftw.

 
http://www.facebook.com/truediamondgame

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
23rd December, 2009 at 16:53:18 -

Wow, this is great I had no idea.

Thanks a lot guys!

 
--

"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!
   

Post Reply



 



Advertisement

Worth A Click