no no no
do it the other way around
use a slide bar and a pusher for the Engine Torque and the tilting for the sterring
Slide Bar code:
rem
rem AGK Application 1.08B11
rem MR
rem X Slider
SetDisplayAspect( 4.0/3.0 )
SetVirtualResolution(200,200)
sprSL=createsprite(0)
setspritesize(sprSL,50,10)
setspriteposition(sprSL,20,20)
sprPush=createsprite(0)
setspritecolor(sprPush,192,1,192,50)
setspritesize(sprPush,10,10)
setspriteposition(sprPush,20,20)
sprSL1=createsprite(0)
setspritesize(sprSL1,10,GetVirtualHeight())
setspriteposition(sprSL1,GetVirtualWidth()-10,0)
sprPush1=createsprite(0)
setspritecolor(sprPush1,192,1,192,50)
setspritesize(sprPush1,10,10)
setspriteposition(sprPush1,GetVirtualWidth()-10,GetVirtualHeight()-10)
do
mx#=getpointerx()
my#=getpointery()
spr=getspritehit(mx#,my#)
if getpointerstate()=1
// On the X Axis , can be used for Steering but better of with Tilting since it will be more fun
if spr=sprPush or spr = sprSl
x#=mx#
if x#<getspritex(sprSL)+getspritewidth(sprPush)/2.0 then x#=getspritex(sprSL)+getspritewidth(sprPush)/2.0
if x#>getspritex(sprSL)+getspritewidth(sprSL)-getspritewidth(sprPush)/2.0 then x#=getspritex(sprSL)+getspritewidth(sprSL)-getspritewidth(sprPush)/2.0
setspritepositionbyoffset(sprPush,x#,getspriteybyoffset(sprPush))
elseif spr=sprPush1 or spr = sprSL1// On Y Axis
y#=my#
if y#<getspritey(sprSL1)+getspriteheight(sprPush1)/2.0 then y#=getspritey(sprSL1)+getspriteheight(sprPush1)/2.0
if y#>getspritey(sprSL1)+getspriteheight(sprSL1)-getspriteheight(sprPush1)/2.0 then y#=getspritey(sprSL1)+getspriteheight(sprSL1)-getspriteheight(sprPush1)/2.0
setspritepositionbyoffset(sprPush1,getspritexbyoffset(sprPush1),y#)
endif
endif
// Lets say that the max Power is 100
// for X Axis
print(GetValueX(sprSL,sprPush)) // Actuall 0.0 to 1.0
print(GetValueX(sprSL,sprPush)*100.0) // multiplay by max Speed / Steering
// For Y Axis
print(1 - GetValueY(sprSL1,sprPush1)) // Actuall 0.0 to 1.0 // These are upside down so thats why ive added 1- at start or 100 -
print(100 - GetValueY(sprSL1,sprPush1)*100.0 ) // Multiply by Max Speed/ Steering
Sync()
loop
function GetValueX(sprSL,sprPush)
x#=(getspritexbyoffset(sprPush)-getspritewidth(sprPush)/2.0)-getspritex(sprSL)
w#=getspritewidth(sprSL)-getspritewidth(sprPush)
v#=x#/w#
endfunction v#
function GetValueY(sprSL,sprPush)
y#=(getspriteybyoffset(sprPush)-getspriteheight(sprPush)/2.0)-getspritey(sprSL)
h#=getspriteheight(sprSL)-getspriteheight(sprPush)
v#=y#/h#
endfunction v#
i think this would fit awesomly while mainting the fun factor.
also in this way you can also create a Gear system for the player if he wants , like Manual Mode in some racing games, only that here you really need to place the right shift. ! cool stuff.
this is not my code btw , its Markus

thnx markus.