I made a simple starfield once using an array of 50 or so stars, I was aiming for something along the lines of "Elite", so hopefully will work for you as well.
I'll see if I can find it for you when I get home this evening.
>Edit<
//*****************************************************************
//
// Simple "space" starfield
//
//*****************************************************************
// Something like Elite? A starfield which gives the impression of
// a ship moving thru space. Also needs to be able to go up, down,
// left, right and maybe rotate left & right as well.
//*****************************************************************
//*****************************************************************
//
// Variables
//
//*****************************************************************
//*****************************************************************
// Constants
//*****************************************************************
#constant true 1
#constant false 0
#constant maxFPS 60
#constant maxStars 99
//*****************************************************************
// Types
//*****************************************************************
type tStarfield
x as float
y as float
direction as integer
starType as integer
endtype
//*****************************************************************
// Dimensioned arrays
//*****************************************************************
dim starfield(maxStars) as tStarfield
//*****************************************************************
// Assign values
//*****************************************************************
` randomise the starfield
for a=0 to maxStars
starfield(a).x=screen width()/2
starfield(a).y=screen height()/2
starfield(a).direction=rnd(360)
starfield(a).startype=rnd(1)
` and then move it along a little
distance=50+rnd(screen width()/2)
inc starfield(a).x,distance*sin(starfield(a).direction)
inc starfield(a).y,distance*cos(starfield(a).direction)
next a
//*****************************************************************
//
// System stuff
//
//*****************************************************************
` screen handling to manual, and cap fps
sync on
sync rate maxFPS
` init the d3d plugin (used for fast dot command)
d3d_init
//*****************************************************************
//
// main loop
//
//*****************************************************************
do
` clears screen as no sprites or 3d yet
cls
` update the stars position
updateStars()
` draws the stars to the screen
drawStars()
` draw some debug
text 0,0,"FPS: "+str$(screen fps())
` updates the screen
sync
loop
end
//*****************************************************************
//
// Functions
//
//*****************************************************************
//*****************************************************************
// drawStars() - draws the stars onto the screen
//*****************************************************************
function drawStars()
local col as integer : col=0
for a=0 to maxStars
if starfield(a).starType=0
col=rgb(255,255,255)
endif
if starfield(a).starType=1
col=rgb(64,64,64)
endif
`dot starfield(a).x,starfield(a).y,col
d3d_dot starfield(a).x,starfield(a).y,col
next a
endfunction
//*****************************************************************
// updateStars() - makes the stars move
//*****************************************************************
function updateStars()
local speed as integer : speed=0
for a=0 to maxStars
if starfield(a).starType=0
speed=2
endif
if starfield(a).starType=1
speed=1
endif
inc starfield(a).x,speed*sin(starfield(a).direction)
inc starfield(a).y,speed*cos(starfield(a).direction)
if upkey()=true
inc starfield(a).y,3
endif
if downkey()=true
dec starfield(a).y,3
endif
if leftkey()=true
inc starfield(a).x,3
endif
if rightkey()=true
dec starfield(a).x,3
endif
if starfield(a).x<0 or starfield(a).x>screen width() or starfield(a).y<0 or starfield(a).y>screen height()
starfield(a).x=screen width()/2
starfield(a).y=screen height()/2
starfield(a).direction=rnd(360)
starfield(a).startype=rnd(1)
` and then move it along a little
distance=50+rnd(screen width()/2)
inc starfield(a).x,distance*sin(starfield(a).direction)
inc starfield(a).y,distance*cos(starfield(a).direction)
endif
next a
endfunction
Sooner than expected, but here is my old starfield code. It's not brilliant, but hopefully will give u a prod in the right direction
It uses cloggy's d3d command for speed, but if you don't have it, just remove the 2 d3d plug in commands and unrem the normal dot command.