Quantcast
Channel: Small Basic
Viewing all articles
Browse latest Browse all 669

Starfield Simulator - Small Basic Featured Program

$
0
0

It's time to feature a new program!

 

Florian Auer created this Starfield Simulator:
 
 
 
Florian's profile image:
Avatar of Florian Auer
 
 
 
You can increase/decrease the speed with the UP/DOWN key up to 60. And if you get to 31, then you enter hyperspace! And don't go to 51 if you have epilepsy! =^)
 
 
 
 
And in this version, bigdaddyo made a tweak:
 
 
 
bigdaddyo added just two lines of code, so that the stars move slowly from the center and speed up
as they pass you:
' Original code 'star_x[i] = star_x[i] + 
Math.Round(speed * (star_x[i] / distance)) 
' star_y[i] = star_y[i] + 
Math.Round(speed * (star_y[i] / distance)) 
' Modified code star_x[i] = star_x[i] + speed 
* star_x[i] * distance 
* 0.0001 star_y[i] = star_y[i] + speed 
* star_y[i] * distance * 0.0001
 
 
Let Florian know what you think in this Small Basic forum thread::
 
 
 
 
As LitDev mentions in that thread, Florian's program runs so smoothly because it is well structured with arrays and subroutines.
 
 
 
Thanks to Florian and BigDaddyO!
 
   - Ninja Ed

Viewing all articles
Browse latest Browse all 669

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>