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 >
Text File  |  1987-04-22  |  2KB  |  39 lines

  1. Star Field 1
  2.  
  3. I hope every body knows what a star field is, for those of you 
  4. who don't know, a star field is a load of moving dots (stars), 
  5. lots of demos have them, as well as games like Xenon 2 and Star 
  6. Wars, The source called STAR1.BAS is a 3 plane jobby which has 30 
  7. stars which move horizontally along the top of the screen
  8.  Here is a quick break down of the source:
  9.  
  10. 80 - 160 these lines calculate the x and y coords of the first 
  11. plane (the lowest and the slowest!), there are 10 points, moving 
  12. 2 pixels to the right each frame (there are 160 frames).
  13.  
  14. as there are 3 planes so there must be 3 routines that calculate 
  15. them.. The other 2 are at 1000, and 2000 , the second plane moves 
  16. at 4 pixels per frame, and the 'closest' plane moves at 8 pixels 
  17. per frame.
  18.  
  19. The loop that actually displays the 30 stars starts at line 170 
  20. here there are 2 'for..next' loops, the first goes from 1 to 160 
  21. (this is each frame), and the second goes from 1 to 30, this 
  22. second one actually plots each seperate point.These 2 loops are 
  23. run non stop, and so the stars glide smoothly across the screen.
  24.  This is the fastest way I have found of moving a star field, 
  25. simple because the main loop only plots 30 points, and doesn't 
  26. have to worry about checking if a point is off the screen, etc, 
  27. etc ( that is done when the frames are calculated at the start of 
  28. the program).
  29.  
  30. The routine runs quite fast when uncompiled but for the best 
  31. results you should compile it !!(It bloddy brilliant!!!!!!!!)
  32.  
  33. I must uickly say thanxs to Philip for his routines ( And I hope 
  34. you do some more!)
  35.  
  36. This is Eddie(ah-YEAH!) signing off.....421991
  37. }
  38.  
  39.