CurveValue
Result# = CurveValue(DestPos#, CurPos#, Speed#)
 
Parameters:

    DestPos#=The destination
    CurPos#=The current position
    Speed#=The speed
Returns:

    Result# = The new position
 

      CurveValue will return an auto-interpolated value based on a given speed. This function will gradually move a value from its current value to a destination value at a given speed.




Mini Tutorial:


      Showing the use of the CurveValue function

  
; Limit the program to 100 updates per second or less
  SetFPS 100
  
; Init circles X/Y positions to the middle of
; of the screen
  x#=GetScreenWidth()/2
  y#=GetScreenHeight()/2
  
; Start of the Repeat/Until loop
  Repeat
     
   ; Clear the screen to dark blue colour
     Cls RGB(0,0,0)
     
   ; Display this message
     Print "Using Curve Value To Home On The Mouse"
     
   ; Curcle the X/Y coords towards the mouses position
     x#= CurveValue(MouseX(), X#, 30.0)
     y#= CurveValue(MouseY(), Y#, 30.0)
     
   ; Draw the object
     Circle X#,y#,30,true
     
   ; Show the screen to the user
     Sync
     
   ; Keep looking until the ESC key is pressed
  Until EscKey()=true
  
  




 
Related Info: CurveAngle | MaxVal | MaxVal# | MidPoint | MinVal | MinVal# :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com