I've never heard of the term "hitscan" but if I understand this correctly, you want to be able to shoot at a target and instantly know whether the player has hit the target, without seeing a bullet move across the screen?
If so then what you can do is create a bullet sprite (a dot say) move it along the line of fire, detect if it's hit a target but do all of this without refreshing the screen.
The below example uses this idea. It's a bit basic, use the up and down arrow keys and spacebar to shoot. The invisible bullet will move horizontally to the right. If a hit is score the word hit will appear on the screen (just under the instructions), otherwise the word miss appears.
`detects if a bullet hits a target
`up and down arrow keys to move player, spacebar to shoot
`the bullet will be fired horizontally to the right from the player
sync on
sync rate 65
hide mouse
set window off
`create a bit map for drawing the sprites on
create bitmap 1, screen width(), screen height()
set current bitmap 1
`create an image (green square) to act as the player
ink rgb(0,255,0), 0
box 0,0, 25,25
get image 1, 0,0, 25,25
`create an image (red square) to act as a target
ink rgb(255,0,0), 0
box 0,0, 25,25
get image 2, 0,0, 25,25
`create an image (white dot) to act as a bullet for the "hitscan"
ink rgb(255,255,255),0
box 0,0,1,1
get image 3, 0,0, 1,1
`set bitmap back to screen and delete bitmap
set current bitmap 0
delete bitmap 1
`set starting variables for the position of the sprites
`player (green box)
x1 = 100
y1 = 100
`target (red box)
x2 = 200
y2 = 100
`bullet (white dot)
x3 = x1
y3 = y1
`main loop
do
cls
`position player
sprite 1, x1,y1, 1
offset sprite 1, 12,12
`position target
sprite 2, x2,y2, 2
offset sprite 2, 12,12
`use arrow keys to move player up and down
if upkey() = 1 then dec y1, 1
if downkey() = 1 then inc y1, 1
`press spacebar to activate "hitscan"
`this if statement just means that the spacebar has to be release to shoot again
if press_space = 0
if spacekey() = 1
press_space = 1
`position bullet on player
x3 = x1
y3 = y1
`loop to check if bullet as hit the target
repeat
`move bullet to the left by one unit
inc x3,1
`position bullet
sprite 3, x3,y3, 3
`delect if bullet sprite has hit target sprite
if sprite hit(3,2) = 1
hit$ = "HIT"
else
hit$ = "MISS"
endif
`exit loop if hit is detected or or bullet goes off the screen
until hit$ = "HIT" or x3 > screen width()
endif
endif
`release the spacebar in order to shoot again
if spacekey() = 0 then press_space = 0
`print
set cursor 0,0
print "Use up and down arrow keys to move player (green box)"
print "Use spacebar to shoot (line of shooting is horizontally to the right)"
print "To score a hit put the green box in line with the red box and press space"
print "To register a miss move the green box below the red box and press space"
print
print hit$
sync
loop
I hope this makes sense and is what you're after.