Posted: 1st Apr 2004 7:43
Easiest way I could think to do it.

+ Code Snippet
f# = 4
x# = 320
y# = 240
planet# = 100
pf# = planet#

do
   cls

   if rightkey() then a# = wrapvalue(a#+1)
   if leftkey() then a# = wrapvalue(a#-1)
   if spacekey() and jump=0
      jump = 1
      force# = f#
   endif


   if jump = 1
      pf# = pf# + force#
      force# = force# - 0.1
      if pf# <= planet# then pf#=planet#: jump=0

   endif

   px#=x# + cos(a#)*pf#
   py#=y# + sin(a#)*pf#


   circle px#, py#, 5
   circle x#, y#, planet#

   set cursor 0,0
   print forcex#
   print forcey#

loop
Posted: 6th Apr 2004 3:03
+ Code Snippet
dim opx#(100)
dim opy#(100)
sync on
sync rate 100
x# = 320
y# = 240
planet# = 100
pf# = planet#
zforce#=2
do
cls

a# = wrapvalue(a#-1)
if scancode()>0
if upkey()=1 then zforce# = zforce#+.2:speed#=speed#+.1
if downkey()=1 then zforce#=zforce#-.3:speed#=speed#-.2
endif
zforce#=zforce#-.02
force#=zforce#

pf# = pf# + force#
force# = force# - 0.1
if pf# <= 1 then pf#=1



for q=100 to 2 step -1
opx#(q)=opx#(q-1)
opy#(q)=opy#(q-1)
next q

opx#(1)=oopx#
opy#(1)=oopy#

oopx#=px#
oopy#=py#

px#=x# + cos(a#)*pf#
py#=y# + sin(a#)*pf#


circle px#, py#, 5
for w=100 to 1 step -1
dot opx#(w),opy#(w)
next w

circle x#, y#, planet#

set cursor 0,0
print zforce#

sync
loop



this is an orbit sim i based off of that code, but it's not very accurate, and i can't get the orbit to be elliptical.