Hi there. I'm not sure I know exactly what your glitch is. You seem to suggest that some characters aren't added to the list at the bottom of the game when they have been hit. However my test of it suggest that it works well. Maybe you could clarify which problem you are having trouble with?
The two issues I noticed were that the total hit counter was not incrementing (stayed on 0) regardless of how many you hit and some of the characters were drawn on top of each other in the list at the bottom of the screen that shows which characters you have hit.
I have resolved these two issues as follows. Your code to handle characters being hit read like this
hitschars(1) = hitschars(1) = 1
where as in fact it should have been this
hitschars(1) = hitschars(1) + 1
so this was why the counter wasn't incrementing. The reason the letters at the bottom overlapped is because you set the y value to 490 (thereby moving them to the bottom of the screen) with this line
but you do nothing to the x position. As the x position is generated randomly with this line
it means that characters that have similar x coordinates will be drawn on top of one another when there y values are made the same. I have fixed this using one method (there would be many solutions). My code is this:
charx(x) = (CharCount(0) * text width("_")) + 10
inc CharCount(0)
As you can see, I use the unused 0 position in your CharCount array to keep a count of how many characters have been hit. I then use this as a multiplier to work out how far along the x axis the character should be placed.
This is the complete code:
Rem Project: TEXTBLASTER PROGRAM!!!
Rem Created: Tuesday, February 21, 2012
REM Designer: Andrew D. South
Rem ***** Main Source File *****
CLS
DIM char$(100)
DIM charx(100)
DIM chary(100)
DIM charspeed(100)
DIM charhit(100)
DIM hitschars(1)
DIM CharCount(1)
SYNC ON
SYNC RATE 30
Rndcounter = 0
White = rgb(255,255,255)
Black = rgb(0,0,0)
` This will set a random seed
SET TEXT OPAQUE
WHILE INKEY$()<>" "
Rndcounter = RND(1000)
INK White,Black
CENTER TEXT 320,240,"TEXT BLASTER!!!"
Rndcolor = rgb(rnd(100)+150,rnd(100)+150,rnd(100)+150)
INK Rndcolor,Black
CENTER TEXT 320,260,"Press Space to Continue"
SYNC
ENDWHILE
RANDOMIZE Rndcounter
SET TEXT TRANSPARENT
InitChars()
hitschars(1) = 0
CharCount(1) = 0
` Loop until 1000 chars have passed
WHILE CharCount(1) < 100
INK 0,0
BOX 0,0,639,479
IF NoneFalling()=1 THEN StartNewFalling()
ProcessText()
DisplayScoreLine()
SYNC
ENDWHILE
CLS
INK White,Black
TempString$ = "You have hit "+STR$(hitschars(1))+" out of "+STR$(100)+"!"
CENTER TEXT 320,240,TempString$
WAIT KEY
END
`Intialize all the characters for falling
FUNCTION InitChars()
FOR x = 1 TO 100
charnum = RND(92)+33
char$(x) = CHR$(charnum)
charx(x) = RND(600)+20
chary(x) = -1
charhit(x) = 0
charspeed(x) = 1
NEXT x
ENDFUNCTION
` Are any characters falling
FUNCTION NoneFalling()
Flag = 1
FOR x = 1 TO 100
IF chary(x) >= 0 AND chary(x) < 450 THEN EXITFUNCTION 0
NEXT x
ENDFUNCTION Flag
`Set some new characters falling
FUNCTION StartNewFalling()
FOR x = 1 TO 4
chary(x+CharCount(1)) = 0
NEXT x
CharCount(1) = CharCount(1) + 4
ENDFUNCTION
`Check the keyboard to see if any of the falling
` Characters have been hit..
FUNCTION ProcessText()
White = RGB(255,255,255)
Black = RGB(0,0,0)
Red = RGB(255,0,0)
FOR x = 1 TO 100
IF chary(x) >= 0 AND chary(x)<450
IF INKEY$() = char$(x)
INK Red,Black
charhit(x) = 1
chary(x) = chary(x) + charspeed(x)
LINE 0,479,charx(x),chary(x)
LINE 0,0,charx,chary(x)
LINE 639,0,charx,chary(x)
LINE 639,479,charx,chary(x)
ELSE
INK White,Black
IF charhit(x) = 1
charx(x) = (CharCount(0) * text width("_")) + 10
inc CharCount(0)
chary(x) = 490
hitschars(1) = hitschars(1) + 1
ELSE
chary(x) = chary(x) + charspeed(x)
ENDIF
ENDIF
TEXT charx(x),chary(x),char$(x)
ENDIF
NEXT x
ENDFUNCTION
`Display the score line...
FUNCTION DisplayScoreLine()
WHITE = RGB(255,255,255)
BLACK = RGB(0,0,0)
INK WHITE,BLACK
STRING$ = "YOU HAVE HIT "+STR$(hitschars(1))+"!"
TEXT 10,465,string$
ENDFUNCTION
I hope that helps. If you clarify exactly what issue you were having trouble with, I'll take another look and see what I can do
.