Quote: "Being the king of sin..."
now there's a cool title

oh and cos :p
thanks but the only reason I use them for everything is because my maths isn't good enough to do anything else
not sure what you need so here's two things I found.
ATANFULL will give you the angle between two points...
ox=320 : oy=240
hide mouse
sync on :sync rate 80
do
for a= 0 to 360
ink 65536*255,0
cx= ox+sin(a)*100
cy= oy+cos(a)*100
circle cx,cy,14
ink 255,0
b= atanfull(ox-cx,oy-cy)
line ox,oy,ox-sin(b)*32,oy-cos(b)*32
sync:cls
next a
loop
Using simple trigonometry you can find the distance between two points, you make a triangle with corners at point A and point B, the third corner at the x of A and y of B...
hide mouse
sprite1x = 320 : sprite1y = 240
sprite2x = 400 : sprite2y = 280
DistX# = ABS(sprite1x - sprite2x)
DistY# = ABS(sprite1y - sprite2y)
Dist# = SQRT( (DistX#*DistX#)+(DistY#*DistY#) )
line sprite1x,sprite1y,sprite2x,sprite1y
line sprite2x,sprite1y,sprite2x,sprite2y
line sprite1x,sprite1y,sprite2x,sprite2y : `hypotenuse
ink rgb(0,255,0),0
circle sprite1x,sprite1y,Dist#
ink rgb(255,255,255),0
circle sprite1x,sprite1y,5
circle sprite2x,sprite2y,5
text sprite1x+10,sprite1y,"Sprite 1"
text sprite2x+10,sprite2y,"Sprite 2"
wait key
[edit]
I found ASCII Adventures!
remstart
-------------------------------------------------------------------
program name: ASCII Adventures
-------------------------------------------------------------------
written by: OBese87
date: 4th August 2007
-------------------------------------------------------------------
comments:
-------------------------------------------------------------------
remend
`--------------
` SETUP
`--------------
set text font "arial",1
set text size 25
hide mouse
gosub create_world
sync on : sync rate 30
`--------------
` MAIN PROGRAM
`--------------
DO
gosub Controls
gosub Screen
gosub Sums
gosub Display
LOOP
END
`--------------
` GOSUBS
`--------------
create_world:
DIM Lvl(500,3)
rem 0:type[0=ground 1=water(odd width) 2=platform(even width)], 1:base height, 2:motion height, 3:color
DIM Ter$(2)
Ter$(0)="="
Ter$(1)="~"
Ter$(2)="¬"
`set default values
for g = 0 to 500
if g <= 73 then Lvl(g,1)=300 else Lvl(g,1)=230+sin(g*3)*20
lvl(g,3) = rgb(255,255,255)
next g
for t = 0 to 500 step 2
lvl(t,3) = rgb(255,0,0)
next t
`add a hill
for hill = 20 to 40
lvl(hill,1) = 300 - sin((hill-20)*9)*20
next hill
`add some water
for water = 50 to 60
lvl(water,0)=1
lvl(water,1)=302
lvl(water,3)=rgb(0,0,160)
next water
`add a platform
for plat = 70 to 73
lvl(plat,0)=2
lvl(plat,1)=260
lvl(plat,3)=rgb(160,160,160)
next plat
RETURN
`---
Controls:
if rightkey()=1 and px-scroll>=0 then inc Px,1
if leftkey()=1 then dec Px,1
`jump
Toggle_State = onepress(57)
If Toggle_State = 1 and ground=1 then jump=10
RETURN
`---
Screen:
`screen scroll
if px-scroll>24 then inc scroll,1
if px-scroll<26 then dec scroll,1
`bind screen scroll
if scroll < 0 then scroll = 0
if scroll > 450 then scroll = 450
`bind player
if px<0 then px=0
if px>480 then px=480
if py>400 then px=0 : py=0
RETURN
`---
Sums:
`gravity
IF jump=0
if ground=0
if py<lvl(px,1)-20 or py>lvl(px,1)
inc py,15
else
if py<lvl(px,1) then ground=1
endif
else
if py>lvl(px,1)+5 then ground=0
if ground=1 then py=lvl(px,1)-17
endif
ELSE
dec py,jump
dec jump,1
ground=0
ENDIF
`get platform height
ph=wave(500,30,10,ph)
RETURN
`---
Display:
cls
print "Xpos: ";px
`*display world
For ter = 0+scroll to 50+scroll
ink lvl(ter,3),0
if lvl(ter,0)=1 then w=wave(ter,5,65,w)
if lvl(ter,0)=2 then lvl(ter,2)=lvl(500,2)
text (ter-scroll)*13, lvl(ter,1)+lvl(ter,2), ter$(lvl(ter,0))
Next ter
`display player
ink rgb(255,255,0),0
text (px-scroll)*13,py+lvl(px,2),"@"
sync
RETURN
`--------------
` FUNCTIONS
`--------------
FUNCTION wave(x,max,spd,h)
h = wrapvalue(h+spd)
Lvl(x,2) = sin(h)*max
ENDFUNCTION h
`---
FUNCTION onepress(key)
if keystate(key) > LastState : ` > trip switch : < release switch
ToggleState = 1
else
ToggleState = 0
endif
LastState = keystate(key) : `this variable will retain its value for the next call
ENDFUNCTION ToggleState
wow I wrote that over a year ago!
A small program that works is better than a large one that doesn't.

DBC Challenge Rank:
Rookie