`header for pregame chat
`place this code at program start
_PlayerType:
Global MaxPlayers
define LMaxPlayers , 10
`for 10 players
MaxPlayers = LMaxPlayers
TYPE  PlayerType
   Name$
   Chat$
   ID
   Color
   MSG$
   MDelay
   Host
   Bot
   ISP$
   Game$
ENDTYPE

DIMTYPE PlayerType, APlayer( LMaxPlayers )
rem Player was replaced by APlayer
`because of naming conflicks with net functions
Global PlayerNumber
for n=1 to LMaxPlayers
   qbc=n
   do
      if qbc<16 then exit
      qbc=qbc-15
   loop
   APlayer(n).Color = QBColor#(qbc)
   `this assumes use of my QBColor array
next n
global MasterTimer
global SendDelay
global TDelay
global SendingPlayer
global SendingDude
dim RPLayer#( LMaxPlayers ,1 ,30)
`1= dudes per player
`30= parameters per dude
global MaxDudes
MaxDudes = 1
`only one snowmobile per player
Global GameMode
`0 or 4 are offline modes
`1= hosting
`2= joining
Global GameStart
`0 is before game initialization
`-1 is game setup mode
`1 is for game in progress
`if reset to 0, the game will exit
_HostJoin:
load bitmap "Ski.bmp",1
`use this bitmap as a control background
copy bitmap 1,0
#include "PregameDB.dba"
define GOHOST , 1
define GOJOIN , 2
define OFFLINE , 3
define GOEXIT , 4

`note: set GameStart to -1 to exit pregamechat
`  and begin game construction ....
`  after all players have finished contruction,
`  set gamestart to 1

reply=HostJoin(1,int(qbcolor#( BLUE )))


select reply
   case GOHOST
      CreateHost(1,int(qbcolor#( BLUE )))
   endcase
   case GOJOIN
      JoinGame(1,int(qbcolor#( GREEN )))
   endcase
   case OFFLINE
      OffGame(1,int(qbcolor#( BLUE )))
   endcase
   case default
      goto _ProgramEnd
   endcase
endselect
if GameMode >0 and GameMode < OFFLINE then PreGameChat(1,int(qbcolor#( GREEN )))
if GameStart =0 then goto _ProgramEnd:
set current bitmap 1
`use this to hide game contruction
`reset to 0 after construction
`and then delete bitmap 1

`these are default master values used by all dudes
RPlayer#(0,0,0)=1:rem dudes per player
RPlayer#(0,0,1)=12:rem data to transmit per dude
RPlayer#(0,0,2)=100:rem max data transmit= 10/sec
