I generally do this sort of thing using my own maths:
// set window properties
SetWindowSize( 800, 480, 0 )
SetVirtualResolution( 800, 480 )
type _var_type
value_min as integer
value_max as integer
value_current as integer
delay as integer
start_time as integer
endtype
var as _var_type
var.value_min = 200
var.value_max = 250
var.delay = 2000
var.value_current = var.value_min
var.start_time = -1
do
// save the current time in milliseconds
current_time = GetMilliseconds()
// press the left mouse button or tap the screen
if GetPointerPressed() = 1
var.start_time = current_time
var.value_current = var.value_min
endif
// if the variable's start time is greater than zero
// then calculate the difference between the start time and the current time
// increase the value of the variable based on how much time has passed
if var.start_time > 0 and var.value_current <= var.value_max
time_difference = current_time - var.start_time
var.value_current = var.value_min+(time_difference*(var.value_max-var.value_min)/var.delay)
if var.value_current > var.value_max
var.value_current = var.value_max
endif
endif
print("press left mouse button or tap screen")
print("")
print("current time in milliseconds : " +str(current_time))
print("start time : " + str(var.start_time))
print("min value : " + str(var.value_min))
print("max value : " + str(var.value_max))
print("current value : " + str(var.value_current))
sync()
loop
Or you can use a customer tween (which I never realised AppGameKit did)
// set window properties
SetWindowSize( 800, 480, 0 )
SetVirtualResolution( 800, 480 )
type _var_type
value_min as integer
value_max as integer
value_current as integer
delay# as float
endtype
var as _var_type
var.value_min = 200
var.value_max = 250
var.delay# = 2.0
my_tween = CreateTweenCustom(var.delay#)
SetTweenCustomInteger1(my_tween,0,var.value_max-var.value_min,0)
do
// press left mouse button or tap screen to start
if GetPointerPressed() = 1
PlayTweenCustom(my_tween,0.0)
endif
// get the tween value
tween_value = GetTweenCustomInteger1(my_tween)
// calculate the current value of the variable
var.value_current = var.value_min + tween_value
print(var.value_current)
UpdateAllTweens( getframetime() )
sync()
loop