@Yodaman
You're not alone, it took me aaages to finally understand how to use functions properly.
I had a bit of a break-through recently when I realised I could make a function that used a "lower-level" function, this helped make everything a lot simpler.
Here's an example of this tiered function idea.
`------------
` Functions
`------------
`---Tier 3---
Function IsoCube(x,y,z,size)
`get vertex co-ords
ax= x-size : bx= x+size
ay= y-size : by= y+size
az= z-size : bz= z+size
rem base
IsoLine(ax,ay,az,ax,ay,bz)
IsoLine(bx,ay,az,ax,ay,az)
rem left side
IsoLine(ax,ay,bz,ax,by,bz)
rem right side
IsoLine(bx,ay,az,bx,by,az)
rem centre side
IsoLine(ax,ay,az,ax,by,az)
rem top face
IsoLine(ax,by,bz,bx,by,bz)
IsoLine(bx,by,bz,bx,by,az)
IsoLine(ax,by,az,ax,by,bz)
IsoLine(bx,by,az,ax,by,az)
Endfunction
`---Tier 2---
rem Isometric Line
Function IsoLine(ax,ay,az,bx,by,bz)
cx= IsoX(ax,ay,az)
cy= IsoY(ax,ay,az)
dx= IsoX(bx,by,bz)
dy= IsoY(bx,by,bz)
line cx,cy,dx,dy
Endfunction
`---Tier 1---
rem Isometric X
Function IsoX(x,y,z)
sx = w(0)+ (x+x)/3. - (z+z)/3.
Endfunction sx
rem Isometric Y
Function IsoY(x,y,z)
sy = h(0)- (x/3. + z/3. + (y+y)/3.)
Endfunction sy
Writing the functions in tiers gives me more flexibility. If I decided I wanted to write some text at an isometric position I could use the lower-tier IsoX/Y/Z functions; if I'd written the IsoLine or IsoCube functions containing the formulas for the IsoX/Y/Z conversion I wouldn't have access to the formulas independently.
Here's a program I used them in.
rem setup
Dim w(0)
Dim h(0)
w(0)= 512
h(0)= 384
Set Display Mode w(0)*2,h(0)*2,32
h(0)= 512 : rem reposition vertical centre for drawing purposes
hide mouse
set text font "tahoma",1
set text size 18
sync on : sync rate 40
rem Define some colours
white = rgb(255,255,255)
grey = rgb(127,127,127)
red = 255*65536
green = 255*256
blue = 255
rem --Axis Lines--
ink white,0
text 0,0,"Here are the 3D axis as they are represented in isometric 2D."
rem X axis
ink red,0
IsoLine(0,0,0,400,0,0)
center text IsoX(420,10,0),IsoY(420,10,0),"X"
rem Y axis
ink green,0
IsoLine(0,0,0,0,400,0)
center text IsoX(0,440,0),IsoY(0,440,0),"Y"
rem Z axis
ink blue,0
IsoLine(0,0,0,0,0,400)
center text IsoX(0,10,420),IsoY(0,10,420),"Z"
sync
wait key
cls 0
rem --Ground Level X/Z Grid--
ink white,0
text 0,0,"This is an X/Z grid positioned at 0 on the Y axis."
For n= 0 to 400 step 40
rem X axis
ink red,0
IsoLine(0,0,n,400,0,n)
rem Z axis
ink blue,0
IsoLine(n,0,0,n,0,400)
Next n
sync
wait key
rem --First Floor X/Z Grid--
rem animate extruding second floor
For y= 0 to 110
cls
ink white,0
text 0,0,"A second floor is extruded to show how 3D height affects 2D position."
For n= 0 to 400 step 40
rem -Ground-
ink white,0
rem X axis
IsoLine(0,0,n,400,0,n)
rem Z axis
IsoLine(n,0,0,n,0,400)
rem -Floor 1-
ink green,0
rem X axis
IsoLine(0,y,n,400,y,n)
rem Z axis
IsoLine(n,y,0,n,y,400)
Next n
sync
Next y
wait key
cls
rem --Join by Y axis--
ink white,0
text 0,0,"The two floors are joined to make an array of cuboids."
For n= 0 to 400 step 40
ink white,0
rem -Ground-
rem X axis
IsoLine(0,0,n,400,0,n)
rem Z axis
IsoLine(n,0,0,n,0,400)
rem -Floor 1-
rem X axis
IsoLine(0,110,n,400,110,n)
rem Z axis
IsoLine(n,110,0,n,110,400)
rem -Joiners-
ink green,0
for z= 0 to 400 step 20
IsoLine(n,0,z,n,110,z)
next z
Next n
sync
wait key
cls
rem --3D Shapes--
ink white,0
text 0,0,"Isometric coordinates can be used to represent 3D objects with relative ease."
rem -Cube-
ink red,0
IsoCube(-75,25,25,25)
rem -Pyramid-
ink green,0
rem base
IsoLine(0,0,0,0,0,50)
IsoLine(50,0,0,0,0,0)
rem left side
IsoLine(0,0,50,25,50,25)
rem right side
IsoLine(50,0,0,25,50,25)
rem centre line
IsoLine(0,0,0,25,50,25)
sync
wait key
cls
END
`------------
` Functions
`------------
`---Tier 3---
Function IsoCube(x,y,z,size)
`get vertex co-ords
ax= x-size : bx= x+size
ay= y-size : by= y+size
az= z-size : bz= z+size
rem base
IsoLine(ax,ay,az,ax,ay,bz)
IsoLine(bx,ay,az,ax,ay,az)
rem left side
IsoLine(ax,ay,bz,ax,by,bz)
rem right side
IsoLine(bx,ay,az,bx,by,az)
rem centre side
IsoLine(ax,ay,az,ax,by,az)
rem top face
IsoLine(ax,by,bz,bx,by,bz)
IsoLine(bx,by,bz,bx,by,az)
IsoLine(ax,by,az,ax,by,bz)
IsoLine(bx,by,az,ax,by,az)
Endfunction
`---Tier 2---
rem Isometric Line
Function IsoLine(ax,ay,az,bx,by,bz)
cx= IsoX(ax,ay,az)
cy= IsoY(ax,ay,az)
dx= IsoX(bx,by,bz)
dy= IsoY(bx,by,bz)
line cx,cy,dx,dy
Endfunction
`---Tier 1---
rem Isometric X
Function IsoX(x,y,z)
sx = w(0)+ (x+x)/3. - (z+z)/3.
Endfunction sx
rem Isometric Y
Function IsoY(x,y,z)
sy = h(0)- (x/3. + z/3. + (y+y)/3.)
Endfunction sy
@All
Does this method slow down the computer?
A small program that works is better than a large one that doesn't.

DBC Challenge Rank:
Rookie