It is currently Thu Apr 09, 2020 2:44 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Game Show Lockout
PostPosted: Tue Dec 03, 2019 7:28 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Oct 24, 2005 1:05 pm
Posts: 721
LOCKOUT PROGRAM FOR GAMES REQUIRING PLAYERS TO "BUZZ IN" SUCH AS JEOPARDY!
ACCOMODATES UP TO 3 PLAYERS BUT CAN BE EXPANDED TO ACCOMODATE MORE
USES NUMERAL KEYS 1,2,3 (NOT NUMERIC KEYPAD)
SHOWS WHICH PLAYER BUZZED IN FIRST, LOCKING OUT OTHER PLAYERS UNTIL RESET BY PRESSING SPACE BAR
CUSTOMIZABLE IN ALL SORTS OF WAYS — YOU CAN ADD SOUND EFFECTS AND SCORING
YOU WILL NEED BUTTONS WHICH SEND NUMERIC KEY CODES TO THE COMPUTER
https://www.compuphase.com/usbkey/usbbutton_en.htm

Code:
;LOCKOUT.PB
;CREATED ON 12/2/2019 by chris319
;LOCKOUT PROGRAM FOR GAMES REQUIRING PLAYERS TO "BUZZ IN" SUCH AS JEOPARDY!
;ACCOMODATES UP TO 3 PLAYERS BUT CAN BE EXPANDED TO ACCOMODATE MORE
;USES NUMERAL KEYS 1,2,3 (NOT NUMERIC KEYPAD)
;SHOWS WHICH PLAYER BUZZED IN FIRST, LOCKING OUT OTHER PLAYERS UNTIL RESET BY PRESSING SPACE BAR
;CUSTOMIZABLE IN ALL SORTS OF WAYS — YOU CAN ADD SOUND EFFECTS AND SCORING
;YOU WILL NEED BUTTONS WHICH SEND NUMERIC KEY CODES TO THE COMPUTER
; https://www.compuphase.com/usbkey/usbbutton_en.htm

InitKeyboard()
LoadFont (1,"arial",24)
#H = 360: #W = 640

OpenWindow(1,0,0,#W,#H,"")
TextGadget(1, 50, 50, 400, 40,"",#PB_Text_Center):SetGadgetFont(1,FontID(1)):SetGadgetColor(1,#PB_Gadget_FrontColor, #White):SetGadgetColor(1,#PB_Gadget_BackColor, #Blue)
SetGadgetText(1,"Enabled")

TextGadget(2, 50, 100, 400, 40,"",#PB_Text_Center):SetGadgetFont(2,FontID(1)):SetGadgetColor(2,#PB_Gadget_FrontColor, #Black):SetGadgetColor(2,#PB_Gadget_BackColor, #Yellow)

AddKeyboardShortcut(1,#PB_Shortcut_1,#PB_Shortcut_1)
AddKeyboardShortcut(1,#PB_Shortcut_2,#PB_Shortcut_2)
AddKeyboardShortcut(1,#PB_Shortcut_3,#PB_Shortcut_3)
AddKeyboardShortcut(1,#PB_Shortcut_Space,#PB_Shortcut_Space)

Repeat:
event = WaitWindowEvent()
   
If event = #PB_Event_CloseWindow: CloseWindow(1): End :EndIf

If event = #PB_Event_Menu ;KEYBOARD INPUT
shortcut = EventMenu()

      If shortcut = #PB_Shortcut_1 And locked = #False: locked = #True: SetGadgetText(2,"Player 1"):  EndIf
      If shortcut = #PB_Shortcut_2 And locked = #False: locked = #True: SetGadgetText(2,"Player 2"):  EndIf
      If shortcut = #PB_Shortcut_3 And locked = #False: locked = #True: SetGadgetText(2,"Player 3"):  EndIf
     
      If shortcut = #PB_Shortcut_Space: locked = #False: EndIf ;SPACE BAR UNLOCKS PLAYERS
     
      If locked = #True:SetGadgetText(1,"Press space bar to reset")
        Else: SetGadgetText(1,"Enabled"):SetGadgetText(2,""):EndIf
   
EndIf

ForEver


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye