neumanix, here is my code with my subroutine for clearing the screen - not sure if it will help?
Regards
Drew
option explicit
#include once "tinyptc.bi"
const xres = 800
const yres = 600
Dim shared as Integer NS
NS=512
Dim shared as Integer x(ns),y(ns)
dim shared as integer r,g,b
Dim Shared as Integer x1(ns),y1(ns)
dim shared as integer r1,g1,b1
Dim Shared as Integer x2(ns),y2(ns)
dim shared as integer r2,g2,b2
Dim Shared as Integer x3(ns),y3(ns)
dim shared as integer r3,g3,b3
Dim shared as Integer a
Dim shared as String key
Declare Sub DrawStars1
Declare Sub MoveStars1
Declare Sub Cler
for a=0 to ns-1
x(a)=int(rnd(1)*xres)
y(a)=int(rnd(1)*yres)
x1(a)=int(rnd(1)*xres)
y1(a)=int(rnd(1)*yres)
x2(a)=int(rnd(1)*xres)
y2(a)=int(rnd(1)*yres)
x3(a)=int(rnd(1)*xres)
y3(a)=int(rnd(1)*yres)
next
r=255:g=255:b=255
r1=192:g1=192:b1=192
r2=128:g2=129:b2=128
r3=64:g3=64:b3=64
If( ptc_open( "Starfield", XRES, YRES ) = 0 ) Then
End -1
End If
Dim Shared sb(xres*yres)
#define PP(x,y,argb) sb(y*XRES+x)=argb
while key<>chr$(27)
key = inkey$()
Cler
DrawStars1
MoveStars1
ptc_update @sb(0)
Wend
Sub DrawStars1
for a=0 to ns-1
pp(x(a),y(a),rgb(r,g,b))
pp(x1(a),y1(a),rgb(r1,g1,b1))
pp(x2(a),y2(a),rgb(r2,g2,b2))
pp(x3(a),y3(a),rgb(r3,g3,b3))
next a
End Sub
Sub MoveStars1
for a=0 to ns-1
x(a)=x(a)+4
x1(a)=x1(a)+3
x2(a)=x2(a)+2
x3(a)=x3(a)+1
if x(a)>=xres then x(a)=0
if x1(a)>=xres then x1(a)=0
if x2(a)>=xres then x2(a)=0
if x3(a)>=xres then x3(a)=0
next a
End Sub
Sub Cler
for a=0 to xres*yres-1
pp(a,0,0)
next a
End Sub