Ok, and here's the same thing with a friction variable. Gets the desired effect, but not sure if i implemented it properly.
sync on
autocam off
type vector
x as float
z as float
endtype
motion as vector
motion.x = 0.0
motion.z = 0.0
friction as vector
friction.x = 0.01
friction.z = 0.01
acceleration# = 0.05
turn# = 2.0
rem starting position
x# = 500.0
z# = 500.0
make matrix 1, 1000,1000,40,40
make object cube 1, 100
scale object 1, 20,10,80
`point camera 500,0,500
position camera -200,300,-200
DO
if upkey()
motion.x = motion.x + sin(angle#)* acceleration#
motion.z = motion.z + cos(angle#)* acceleration#
endif
if downkey()
motion.x = motion.x + sin(angle#)* -acceleration#
motion.z = motion.z + cos(angle#)* -acceleration#
endif
if rightkey()
angle# = wrapvalue(angle# + turn#)
endif
if leftkey()
angle# = wrapvalue(angle# - turn#)
endif
if motion.x > 0
motion.x = motion.x - friction.x
else
motion.x = motion.x + friction.x
endif
if motion.z > 0
motion.z = motion.z - friction.z
else
motion.z = motion.z + friction.z
endif
x# = x# + motion.x
Z# = z# + motion.z
yrotate object 1, angle#
position object 1, x#, 5.0, z#
point camera x#, 0, z#
set cursor 0,0
print "Vector X: ", motion.x
print "Vector Z: ", motion.z
sync
LOOP
"eureka" - Archimedes