home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Falcon 030 Power 2
/
F030_POWER2.iso
/
ST_STE
/
MAGS
/
STOSBTS1.ARJ
/
stosbts1.msa
/
DATA
/
STAR1.DAT
< prev
next >
Wrap
Text File
|
1987-04-22
|
2KB
|
39 lines
Star Field 1
I hope every body knows what a star field is, for those of you
who don't know, a star field is a load of moving dots (stars),
lots of demos have them, as well as games like Xenon 2 and Star
Wars, The source called STAR1.BAS is a 3 plane jobby which has 30
stars which move horizontally along the top of the screen
Here is a quick break down of the source:
80 - 160 these lines calculate the x and y coords of the first
plane (the lowest and the slowest!), there are 10 points, moving
2 pixels to the right each frame (there are 160 frames).
as there are 3 planes so there must be 3 routines that calculate
them.. The other 2 are at 1000, and 2000 , the second plane moves
at 4 pixels per frame, and the 'closest' plane moves at 8 pixels
per frame.
The loop that actually displays the 30 stars starts at line 170
here there are 2 'for..next' loops, the first goes from 1 to 160
(this is each frame), and the second goes from 1 to 30, this
second one actually plots each seperate point.These 2 loops are
run non stop, and so the stars glide smoothly across the screen.
This is the fastest way I have found of moving a star field,
simple because the main loop only plots 30 points, and doesn't
have to worry about checking if a point is off the screen, etc,
etc ( that is done when the frames are calculated at the start of
the program).
The routine runs quite fast when uncompiled but for the best
results you should compile it !!(It bloddy brilliant!!!!!!!!)
I must uickly say thanxs to Philip for his routines ( And I hope
you do some more!)
This is Eddie(ah-YEAH!) signing off.....421991
}