Hi,
I am creating a game in which players have to enter their names before they play. There can be many players; up to 32 in fact although there is also a single player mode. The problem is that when people are entering their names, the response is very slow meaning that if you touch type, only one in two or three letters will be picked up. Further, if you wish to delete a letter, I recon it takes about 20 or more hits of the backspace button before the program removes a letter. This is the code which I use for gaining the input in single player mode. This suffers from the problem just as badly as multiplayer mode.
REM *** Check for Commands ***
repeat
nMouse = 0
nKey = 0
sKey$ = ""
repeat
nMouse = mouseclick()
nKey = scancode()
sKey$ = inkey$()
PrintSinglePlayer()
until nMouse = 1 OR nKey > 0 OR sKey$ <> ""
nMouseX = mousex()
nMouseY = mousey()
REM *** Perform Commands ***
if ButtonClick(13,nMouseX,nMouseY) = 1 and nMouse <> 0
bBack = 1
nScreenLoad = 2
bExtendedTime = 0
set sprite frame 13,2
nTime = timer()
repeat
PrintSinglePlayer()
until timer() - nTime > 500
exitfunction
endif
if ButtonClick(21,nMouseX,nMouseY) = 1 and nMouse <> 0
if aPlayers(1).sName <> "" AND nNoOfRounds > 0
nEnterPressed = 1
set sprite frame 21,2
nTime = timer()
repeat
PrintSinglePlayer()
until timer() - nTime > 500
else
set sprite frame 21,2
nTime = timer()
repeat
PrintSinglePlayer()
until timer() - nTime > 500
set sprite frame 21,1
endif
endif
if ButtonClick(39,nMouseX,nMouseY) = 1 and nMouse <> 0
if sprite frame(39) = 1
set sprite frame 39,2
bExtendedTime = 1
else
set sprite frame 39,1
bExtendedTime = 0
endif
nTime = timer()
repeat
PrintSinglePlayer()
until timer() - nTime > 500
endif
if sKey$ <> ""
if len(aPlayers(1).sName) <= 16
aPlayers(1).sName = aPlayers(1).sName + sKey$
nTime = timer()
repeat
PrintSinglePlayer()
until timer() - nTime > 150
endif
endif
if nKey = 14
if len(aPlayers(1).sName) > 0
aPlayers(1).sName = left$(aPlayers(1).sName,(len(aPlayers(1).sName)-1))
endif
nTime = timer()
repeat
PrintSinglePlayer()
until timer() - nTime > 150
endif
if ButtonClick(9,nMouseX,nMouseY) = 1 and nMouse <> 0
set sprite frame 9,2
set sprite frame 10,1
set sprite frame 11,1
set sprite frame 8,1
nNoOfRounds = 1
endif
if ButtonClick(10,nMouseX,nMouseY) = 1 and nMouse <> 0
set sprite frame 10,2
set sprite frame 9,1
set sprite frame 11,1
set sprite frame 8,1
nNoOfRounds = 3
endif
if ButtonClick(8,nMouseX,nMouseY) = 1 and nMouse <> 0
set sprite frame 8,2
set sprite frame 10,1
set sprite frame 11,1
set sprite frame 9,1
nNoOfRounds = 5
endif
if ButtonClick(11,nMouseX,nMouseY) = 1 and nMouse <> 0
set sprite frame 11,2
set sprite frame 10,1
set sprite frame 9,1
set sprite frame 8,1
nNoOfRounds = 7
endif
until nEnterPressed > 0 OR bBack > 0
Can anyone please guide me on why this problem may be occuring and what I might be able to do to solve it. Thanks in advance,
Lucas Tiridath