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.

Newcomers DBPro Corner / Refining joystick buttons

Author
Message
Stavdav
17
Years of Service
User Offline
Joined: 4th May 2007
Location:
Posted: 4th May 2007 21:05
I have plugged the usb quiz controllers from the PS2 game "Buzz"(it maybe just in Europe I don't know. It's four 5 buttoned pads that go into a mini hub and then plug into the usb) to my PC. It can be used as a 20 button controller basically. I've messed around and made programs to decide the fastest finger and things. I did this with if commands listening for the main buttons to be pressed:

if (joystick fire x(f) && 1) = 1

What I want to do is assign the pads to different players, how can I do:

Player 1 press your buzzer

and record which pad the player has in a array with the player name.

Please help I'm stupid.

Attachments

Login to view attachments
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 5th May 2007 03:26 Edited at: 5th May 2007 03:27
Why couldn't you just print "Player 1, press your buzzer" and then use a loop to check all four of the buzzer buttons to see which one is pressed? Then you could place the value of the number [the joystick fire x (number)] of the buzzer that is pressed into an array. You would need to do error checking in case two or more of the buttons are pressed at the same time.

Then simply input their name into a string array [i.e. input "Enter your name: ";PlayerName$(1)]. Do this for all the players and you are good to go.

I would use separate arrays to identify the joystick fire x(number) associated with a particular player and the player's name. You would just use the same value to associate them both. Player(3) would correspond to PlayerName$(3), etc.

I hope this answers your questions.


LB

Login to post a reply

Server time is: 2024-11-25 17:28:35
Your offset time is: 2024-11-25 17:28:35