Hello
i dont know if this is the right topic section, but anyway...i am a newcomer.
i made this little solar system thing and was wondering what everyone tought about. any comments, good or bad (cant beat a bit of constructive critism), would be appreciated but please keep in mind its only like my second (working) program. the code ended up being really long, is there a more efficient way to code it
Slan,Tabhaire aire duit fein!
jomo
sync on
sync rate 0
hide mouse
`PLANET OBJECTS CONSTANTS, INDENTS ARE MOON CONSTANTS
sun = 100
mercury = 1
venus = 2
earth = 3
earthone = 31
mars = 4
marsone = 41
marstwo = 42
jupiter = 5
jupiterone = 51
jupitertwo = 52
jupiterthree = 53
jupiterfour = 54
jupiterfive = 55
jupitersix = 56
jupiterseven = 57
jupitereight = 58
jupiternine = 59
jupiterten = 510
jupitereleven = 511
jupitertwelve = 512
saturn = 6
saturnone = 61
saturntwo = 62
saturnthree = 63
saturnfour = 64
saturnfive = 65
saturnsix = 66
saturnseven = 67
saturneight = 68
saturnnine = 69
uranus = 7
uranusone = 71
uranustwo = 72
uranusthree = 73
uranusfour = 74
uranusfive = 75
neptune = 8
neptuneone = 81
neptunetwo = 82
pluto = 9
plutoone = 91
`STANDARD DIAMETER
diameter# = 5
`SHORTENS THE DISTANCE FROM THE SUN
distancefactor# = 0.4
`INCREASE TO SPEED THINGS UP, DECREASE TO SLOW THINGS DOWN
speedfactor# = 1
`MAKE PLANETS/MOONS AND POSITION THEM
`NUMBER MULTIPLING "DIAMETER#" IS THE RATIO OF THAT PLANETS DIAMETER TO THE EARTH
`NUMBER MULTIPLYING "DISTANCEFACTOR#" IS THE DISTANCE OF THAT PLANET FROM THE SUN
`THREE OUTER PLANET HAVE BEEN MOVED CLOSER
`SUN
make object sphere sun, 25
position object sun,0,0,0
color object sun, RGB(255,255,0)
`MERCURY
make object sphere mercury, diameter#*0.38
position object mercury, 58*distancefactor#, 0, 0
color object mercury, RGB(240,192,200)
`VENUS
make object sphere venus, diameter#*0.96
position object venus, 108*distancefactor#, 0, 0
color object venus, RGB(192,96,96)
`EARTH
make object sphere earth, diameter#*1
position object earth, 150*distancefactor#, 0, 0
color object earth, RGB(0,0,255)
make object sphere earthone, diameter#*0.27
position object earthone, object position x(earth)+(diameter#*1)+1,0,0
color object earthone, RGB(168,172,168)
`MARS
make object sphere mars, diameter#*0.5
position object mars, 228*distancefactor#,0,0
color object mars, RGB(232,0,0)
make object sphere marsone, diameter#*0.27
position object marsone,object position x(mars)+(diameter#*0.5)+1,0,0
color object marsone, RGB(168,172,168)
make object sphere marstwo, diameter#*0.27
position object marstwo,object position x(mars)+(diameter#*0.5)+3,0,0
color object marstwo, RGB(168,172,168)
`JUPITER
make object sphere jupiter, diameter#*11.2
position object jupiter, 777*distancefactor#,0,0
color object jupiter, RGB(184,208,248)
for i = 51 to 59
make object sphere i, diameter#*0.5
color object i, RGB(168,172,168)
position object i, object position x(jupiter)+(diameter#*11.2)*0.75+(i-50)*6,0,0
next i
for i = 510 to 512
make object sphere i, diameter#*0.5
color object i,RGB(168,172,168)
position object i,object position x(jupiternine)+(i-509)*6,0,0
next i
`SATURN
make object sphere saturn, diameter#*9.4
position object saturn, 1425*distancefactor#,0,0
color object saturn, RGB(255,140,24)
for i = 61 to 69
make object sphere i, diameter#*0.45
color object i,RGB(168,172,168)
position object i, object position x(saturn)+diameter#*9.4 + (i-60)*6,0,0
next i
`URANUS
make object sphere uranus, diameter#*4.0
position object uranus, 2200*distancefactor#,0,0
color object uranus, RGB(104,132,168)
for i = 71 to 75
make object sphere i, diameter#*0.4
color object i ,RGB(168,172,168)
position object i,object position x(uranus)+diameter#*4.0 + (i-70)*5,0,0
next i
`NEPTUNE
make object sphere neptune, diameter#*3.8
position object neptune, 2600*distancefactor#,0,0
color object neptune, RGB(64,32,208)
make object sphere neptuneone, diameter#*0.4
color object neptuneone,RGB(168,172,168)
position object neptuneone, object position x(neptune)+diameter#*3.8+5,0,0
make object sphere neptunetwo, diameter#*0.4
color object neptunetwo,RGB(168,172,168)
position object neptunetwo, object position x(neptune)+diameter#*3.8+10,0,0
`PLUTO
make object sphere pluto, diameter#*0.6
position object pluto, 2800*distancefactor#,0,0
color object pluto, RGB(255,0,255)
make object sphere plutoone, diameter#*0.3
color object plutoone,RGB(168,172,168)
position object plutoone, object position x(pluto)+diameter#*0.6+5,0,0
color backdrop RGB(64,64,64)
position camera 0,1000,0
point camera 0,0,0
`ANGLE VARIABLES, USED TO VARY SPEED OF INDIVIDUAL CELESTIAL BODIES WITH "INC" AND "DEC"
mercuryangle# = 0
venusangle# = 0
earthangle# = 0
earthoneangle# = 0
marsangle# = 0
marsoneangle# = 0
marstwoangle# = 0
jupiterangle# = 0
jupiteroneangle# = 0
jupitertwoangle# = 0
jupiterthreeangle# = 0
jupiterfourangle# = 0
jupiterfiveangle# = 0
jupitersixangle# = 0
jupitersevenangle# = 0
jupitereightangle# = 0
jupiternineangle# = 0
jupitertenangle# = 0
jupiterelevenangle# = 0
jupitertwelveangle# = 0
saturnangle# = 0
saturnoneangle# = 0
saturntwoangle# = 0
saturnthreeangle# = 0
saturnfourangle# = 0
saturnfiveangle# = 0
saturnsixangle# = 0
saturnsevenangle# = 0
saturneightangle# = 0
saturnnineangle# = 0
uranusangle# = 0
uranusoneangle# = 0
uranustwoangle# = 0
uranusthreeangle# = 0
uranusfourangle# = 0
uranusfiveangle# = 0
neptuneangle# = 0
neptuneoneangle# = 0
neptunetwoangle# = 0
plutoangle# = 0
plutooneangle# = 0
`MORE CONSTANTS!!
`DISTANCE OF EACH MOON TO ITS PLANET
`EARTH
emone# = object position x(earthone)-object position x(earth)
`MARS
mmone# = object position x(marsone)-object position x(mars)
mmtwo# = object position x(marstwo)-object position x(mars)
`JUPITER
jmone# = object position x(jupiterone)-object position x(jupiter)
jmtwo# = object position x(jupitertwo)-object position x(jupiter)
jmthree# = object position x(jupiterthree)-object position x(jupiter)
jmfour# = object position x(jupiterfour)-object position x(jupiter)
jmfive# = object position x(jupiterfive)-object position x(jupiter)
jmsix# = object position x(jupitersix)-object position x(jupiter)
jmseven# = object position x(jupiterseven)-object position x(jupiter)
jmeight# = object position x(jupitereight)-object position x(jupiter)
jmnine# = object position x(jupiternine)-object position x(jupiter)
jmten# = object position x(jupiterten)-object position x(jupiter)
jmeleven# = object position x(jupitereleven)-object position x(jupiter)
jmtwelve# = object position x(jupitertwelve)-object position x(jupiter)
`SATURN
smone# = object position x(saturnone)-object position x(saturn)
smtwo# = object position x(saturntwo)-object position x(saturn)
smthree# = object position x(saturnthree)-object position x(saturn)
smfour# = object position x(saturnfour)-object position x(saturn)
smfive# = object position x(saturnfive)-object position x(saturn)
smsix# = object position x(saturnsix)-object position x(saturn)
smseven# = object position x(saturnseven)-object position x(saturn)
smeight# = object position x(saturneight)-object position x(saturn)
smnine# = object position x(saturnnine)-object position x(saturn)
`URANUS
umone# = object position x(uranusone)-object position x(uranus)
umtwo# = object position x(uranustwo)-object position x(uranus)
umthree# = object position x(uranusthree)-object position x(uranus)
umfour# = object position x(uranusfour)-object position x(uranus)
umfive# = object position x(uranusfive)-object position x(uranus)
`NEPTUNE
nmone# = object position x(neptuneone)-object position x(neptune)
nmtwo# = object position x(neptunetwo)-object position x(neptune)
`PLUTO
pmone# = object position x(plutoone)-object position x(pluto)
do
`SCREEN INFO
s = screen fps()
set cursor 0,0
print "FPS ",s
`INSTRUCTIONS
print "Use Mouse to move Camera Up, Down, Left and Right"
print "Left Click Mouse to Zoom In"
print "Right Click Mouse to Zoom Out"
print "Enjoy!!"
`CAMERA POSITION VARIABLES
cax# = camera position x()
cay# = camera position y()
caz# = camera position z()
`USE MOUSE TO MOVE CAMERA
caz# = caz# - mousemovey()
cax# = cax# + mousemovex()
`USE LEFT/RIGHT CLICK TO ZOOM
if mouseclick() = 1
cay# = cay# - 5
endif
if mouseclick() = 2
cay# = cay# + 5
endif
`REPOSITION CAMERA
position camera cax#,cay#,caz#
`MOVE MERCURY
x#=58*distancefactor#*cos(wrapvalue(mercuryangle#))
z#=58*distancefactor#*sin(wrapvalue(mercuryangle#))
position object mercury,x#,0,z#
inc mercuryangle#, speedfactor#*0.6
`MOVE VENUS
x#=108*distancefactor#*cos(wrapvalue(venusangle#))
z#=108*distancefactor#*sin(wrapvalue(venusangle#))
position object venus,x#,0,z#
inc venusangle#, speedfactor#*0.45
`MOVE EARTH/MOON
x#=150*distancefactor#*cos(wrapvalue(earthangle#))
z#=150*distancefactor#*sin(wrapvalue(earthangle#))
position object earth,x#,0,z#
inc earthangle#, speedfactor#*0.37
x#=emone#*cos(wrapvalue(earthoneangle#)) + object position x(earth)
z#=emone#*sin(wrapvalue(earthoneangle#)) + object position z(earth)
position object earthone,x#,0,z#
dec earthoneangle#, speedfactor#*1.2
`MOVE MARS/MOON
x#=228*distancefactor#*cos(wrapvalue(marsangle#))
z#=228*distancefactor#*sin(wrapvalue(marsangle#))
position object mars,x#,0,z#
inc marsangle#, speedfactor#*0.3
x#=mmone#*cos(wrapvalue(marsoneangle#)) + object position x(mars)
z#=mmone#*sin(wrapvalue(marsoneangle#)) + object position z(mars)
position object marsone,x#,0,z#
dec marsoneangle#, speedfactor#*1.2
x#=mmtwo#*cos(wrapvalue(marstwoangle#)) + object position x(mars)
z#=mmtwo#*sin(wrapvalue(marstwoangle#)) + object position z(mars)
position object marstwo,x#,0,z#
inc marstwoangle#, speedfactor#*1.4
`MOVE JUPITER/MOON
x#=777*distancefactor#*cos(wrapvalue(jupiterangle#))
z#=777*distancefactor#*sin(wrapvalue(jupiterangle#))
position object jupiter,x#,0,z#
inc jupiterangle#, speedfactor#*0.175
x#=jmone#*cos(wrapvalue(jupiteroneangle#)) + object position x(jupiter)
z#=jmone#*sin(wrapvalue(jupiteroneangle#)) + object position z(jupiter)
position object jupiterone,x#,0,z#
dec jupiteroneangle#, speedfactor#*2.3
x#=jmtwo#*cos(wrapvalue(jupitertwoangle#)) + object position x(jupiter)
z#=jmtwo#*sin(wrapvalue(jupitertwoangle#)) + object position z(jupiter)
position object jupitertwo,x#,0,z#
inc jupitertwoangle#, speedfactor#*1.78
x#=jmthree#*cos(wrapvalue(jupiterthreeangle#)) + object position x(jupiter)
z#=jmthree#*sin(wrapvalue(jupiterthreeangle#)) + object position z(jupiter)
position object jupiterthree,x#,0,z#
dec jupiterthreeangle#, speedfactor#*1.65
x#=jmfour#*cos(wrapvalue(jupiterfourangle#)) + object position x(jupiter)
z#=jmfour#*sin(wrapvalue(jupiterfourangle#)) + object position z(jupiter)
position object jupiterfour,x#,0,z#
inc jupiterfourangle#, speedfactor#*1.5
x#=jmfive#*cos(wrapvalue(jupiterfiveangle#)) + object position x(jupiter)
z#=jmfive#*sin(wrapvalue(jupiterfiveangle#)) + object position z(jupiter)
position object jupiterfive,x#,0,z#
dec jupiterfiveangle#, speedfactor#*1.456
x#=jmsix#*cos(wrapvalue(jupitersixangle#)) + object position x(jupiter)
z#=jmsix#*sin(wrapvalue(jupitersixangle#)) + object position z(jupiter)
position object jupitersix,x#,0,z#
inc jupitersixangle#, speedfactor#*1.33
x#=jmseven#*cos(wrapvalue(jupitersevenangle#)) + object position x(jupiter)
z#=jmseven#*sin(wrapvalue(jupitersevenangle#)) + object position z(jupiter)
position object jupiterseven,x#,0,z#
dec jupitersevenangle#, speedfactor#*1.23
x#=jmeight#*cos(wrapvalue(jupitereightangle#)) + object position x(jupiter)
z#=jmeight#*sin(wrapvalue(jupitereightangle#)) + object position z(jupiter)
position object jupitereight,x#,0,z#
inc jupitereightangle#, speedfactor#*1.18
x#=jmnine#*cos(wrapvalue(jupiternineangle#)) + object position x(jupiter)
z#=jmnine#*sin(wrapvalue(jupiternineangle#)) + object position z(jupiter)
position object jupiternine,x#,0,z#
dec jupiternineangle#, speedfactor#*1.0
x#=jmten#*cos(wrapvalue(jupitertenangle#)) + object position x(jupiter)
z#=jmten#*sin(wrapvalue(jupitertenangle#)) + object position z(jupiter)
position object jupiterten,x#,0,z#
inc jupitertenangle#, speedfactor#*0.837
x#=jmeleven#*cos(wrapvalue(jupiterelevenangle#)) + object position x(jupiter)
z#=jmeleven#*sin(wrapvalue(jupiterelevenangle#)) + object position z(jupiter)
position object jupitereleven,x#,0,z#
dec jupiterelevenangle#, speedfactor#*0.75
x#=jmtwelve#*cos(wrapvalue(jupitertwelveangle#)) + object position x(jupiter)
z#=jmtwelve#*sin(wrapvalue(jupitertwelveangle#)) + object position z(jupiter)
position object jupitertwelve,x#,0,z#
inc jupitertwelveangle#, speedfactor#*0.61
`MOVE SATURN/MOON
x#=1425*distancefactor#*cos(wrapvalue(saturnangle#))
z#=1425*distancefactor#*sin(wrapvalue(saturnangle#))
position object saturn,x#,0,z#
inc saturnangle#, speedfactor#*0.15
x#=smone#*cos(wrapvalue(saturnoneangle#)) + object position x(saturn)
z#=smone#*sin(wrapvalue(saturnoneangle#)) + object position z(saturn)
position object saturnone,x#,0,z#
dec saturnoneangle#, speedfactor#*2.0
x#=smtwo#*cos(wrapvalue(saturntwoangle#)) + object position x(saturn)
z#=smtwo#*sin(wrapvalue(saturntwoangle#)) + object position z(saturn)
position object saturntwo,x#,0,z#
inc saturntwoangle#, speedfactor#*1.75
x#=smthree#*cos(wrapvalue(saturnthreeangle#)) + object position x(saturn)
z#=smthree#*sin(wrapvalue(saturnthreeangle#)) + object position z(saturn)
position object saturnthree,x#,0,z#
dec saturnthreeangle#, speedfactor#*1.63
x#=smfour#*cos(wrapvalue(saturnfourangle#)) + object position x(saturn)
z#=smfour#*sin(wrapvalue(saturnfourangle#)) + object position z(saturn)
position object saturnfour,x#,0,z#
inc saturnfourangle#, speedfactor#*1.53
x#=smfive#*cos(wrapvalue(saturnfiveangle#)) + object position x(saturn)
z#=smfive#*sin(wrapvalue(saturnfiveangle#)) + object position z(saturn)
position object saturnfive,x#,0,z#
dec saturnfiveangle#, speedfactor#*1.45
x#=smsix#*cos(wrapvalue(saturnsixangle#)) + object position x(saturn)
z#=smsix#*sin(wrapvalue(saturnsixangle#)) + object position z(saturn)
position object saturnsix,x#,0,z#
inc saturnsixangle#, speedfactor#*1.3
x#=smseven#*cos(wrapvalue(saturnsevenangle#)) + object position x(saturn)
z#=smseven#*sin(wrapvalue(saturnsevenangle#)) + object position z(saturn)
position object saturnseven,x#,0,z#
dec saturnsevenangle#, speedfactor#*1.23
x#=smeight#*cos(wrapvalue(saturneightangle#)) + object position x(saturn)
z#=smeight#*sin(wrapvalue(saturneightangle#)) + object position z(saturn)
position object saturneight,x#,0,z#
inc saturneightangle#, speedfactor#*1.05
x#=smnine#*cos(wrapvalue(saturnnineangle#)) + object position x(saturn)
z#=smnine#*sin(wrapvalue(saturnnineangle#)) + object position z(saturn)
position object saturnnine,x#,0,z#
dec saturnnineangle#, speedfactor#*0.9
`MOVE URANUS/MOON
x#=2200*distancefactor#*cos(wrapvalue(uranusangle#))
z#=2200*distancefactor#*sin(wrapvalue(uranusangle#))
position object uranus,x#,0,z#
inc uranusangle#, speedfactor#*0.11
x#=umone#*cos(wrapvalue(uranusoneangle#)) + object position x(uranus)
z#=umone#*sin(wrapvalue(uranusoneangle#)) + object position z(uranus)
position object uranusone,x#,0,z#
dec uranusoneangle#, speedfactor#*2
x#=umtwo#*cos(wrapvalue(uranustwoangle#)) + object position x(uranus)
z#=umtwo#*sin(wrapvalue(uranustwoangle#)) + object position z(uranus)
position object uranustwo,x#,0,z#
inc uranustwoangle#, speedfactor#*1.56
x#=umthree#*cos(wrapvalue(uranusthreeangle#)) + object position x(uranus)
z#=umthree#*sin(wrapvalue(uranusthreeangle#)) + object position z(uranus)
position object uranusthree,x#,0,z#
dec uranusthreeangle#, speedfactor#*1.33
x#=umfour#*cos(wrapvalue(uranusfourangle#)) + object position x(uranus)
z#=umfour#*sin(wrapvalue(uranusfourangle#)) + object position z(uranus)
position object uranusfour,x#,0,z#
inc uranusfourangle#, speedfactor#*1.1
x#=umfive#*cos(wrapvalue(uranusfiveangle#)) + object position x(uranus)
z#=umfive#*sin(wrapvalue(uranusfiveangle#)) + object position z(uranus)
position object uranusfive,x#,0,z#
dec uranusfiveangle#, speedfactor#*0.8
`MOVE NEPTUNE/MOON
x#=2600*distancefactor#*cos(wrapvalue(neptuneangle#))
z#=2600*distancefactor#*sin(wrapvalue(neptuneangle#))
position object neptune,x#,0,z#
inc neptuneangle#, speedfactor#*0.08
x#=nmone#*cos(wrapvalue(neptuneoneangle#)) + object position x(neptune)
z#=nmone#*sin(wrapvalue(neptuneoneangle#)) + object position z(neptune)
position object neptuneone,x#,0,z#
dec neptuneoneangle#, speedfactor#*2.0
x#=nmtwo#*cos(wrapvalue(neptunetwoangle#)) + object position x(neptune)
z#=nmtwo#*sin(wrapvalue(neptunetwoangle#)) + object position z(neptune)
position object neptunetwo,x#,0,z#
dec neptunetwoangle#, speedfactor#*1.3
`MOVE PLUTO/MOON
x#=2800*distancefactor#*cos(wrapvalue(plutoangle#))
z#=2800*distancefactor#*sin(wrapvalue(plutoangle#))
position object pluto,x#,0,z#
inc plutoangle#, speedfactor#*0.05
x#=pmone#*cos(wrapvalue(plutooneangle#)) + object position x(pluto)
z#=pmone#*sin(wrapvalue(plutooneangle#)) + object position z(pluto)
position object plutoone,x#,0,z#
dec plutooneangle#, speedfactor#*1.5
sync
loop