DIM sprite(1000) as integer

DIM vmem(64000) as mem(0A0000h) byte

Screen 13

for i = 0 to 64000
  vmem(i) = rnd(248)
next i

for i = 0 to 100
  pset rnd(248), rnd(199), rnd(148)
next i

vget 40, 0, 80, 40, sprite(0)
fillbox 0, 0, 319, 199, 0

x = 100
y = 100
lx = 0
ly = 0

endloop = 0
a$ = ""

do while not endloop = 1
  a$ = inkey$

  SELECT CASE a$
  Case "a" 
    x = x - 5
  Case "d" 
    x = x + 5
  Case "w" 
    y = y - 5
  Case "s" 
    y = y + 5
  Case "q"
    endloop = 1
  END Select

  if not lx = x OR not ly = y then
    fillbox 0,0,319,199, 0
    vsput x, y, sprite(0)
    lx = x
    ly = y
  end if

loop

screen 0
end

