here is Gimpy's original version converted to lua:
--original bmx code by GIMPY
require("Scripts/constants/engine_const")
RegisterAbstractPath("")
Graphics(800,600)
fw=CreateFramework()
fw.main.camera:SetPosition(Vec3(0, 45, - 45))
light = CreateDirectionalLight()
light:SetRotation(Vec3(65, 45, 0))
piv = CreatePivot()
cube = CreateCube()
plane = CreatePlane()
plane:SetScale(Vec3(100,0.1,100))
plane:Paint(LoadMaterial("abstract::cobblestones.mat"))
while KeyHit(KEY_ESCAPE)==0 do
fw.main.camera:SetPosition(Vec3(cube.position.x,cube.position.y+25,cube.position.z-25))
fw.main.camera:Point(cube,3,1)
if MouseDown(1)==1 then
local pick = CameraPick(fw.main.camera, Vec3(MouseX(), MouseY(), 1000))
if pick~=nil then
piv:SetPosition(Vec3(pick.position.x,.5,pick.position.z))
cube:Point(piv,3,1)
speed = 0.3
end
end
if EntityDistance(cube,piv)<1.2 then speed = 0 end
cube:Move(Vec3(0,0,speed))
fw:Update()
fw:Render()
Flip(1)
end