I see where your problem is, you've made the movement and accel into a sub-routine and you keep resetting the variables just like Andy said. Try declaring your variables at the start of your program and only set them once - Like this...
autocam off
forward as boolean
reverse as boolean
speed as float
accel as float
top as float
speed= 0
accel= 0.0001
top= 0.1
make object cube 3,2.5
position object 3,0,0,0
position camera 0,40,0
point camera 0,0,0
sync on
do
gosub _control_player
`put gosubs for camera controls
`and other stuff here
sync
loop
end
`put all subs outside of main loop for neater code
_control_player:
if upkey() = 1
speed = speed + accel
endif
if downkey()=1
speed = speed - accel
endif
if speed > top then speed = top
if speed < -top then speed = -top
if speed > 0 then forward = 1:reverse = 0
if speed < 0 then forward = 0:reverse = 1
move object 3, speed
if leftkey()=1 and forward > 0 then yrotate object 3, wrapvalue(object angle y(3)-.3)
if leftkey()=1 and reverse > 0 then yrotate object 3, wrapvalue(object angle y(3)+.3)
if rightkey()=1 and forward > 0 then yrotate object 3, wrapvalue(object angle y(3)+.3)
if rightkey()=1 and reverse > 0 then yrotate object 3, wrapvalue(object angle y(3)-.3)
return
I left out the collision stuff for clarity...
Personally, I would make my sub a function so that I could colapse it in the GUI to make things neater(plus I just like using functions)
Hope this helps!
It's all fun and games 'till someone loses an arm...