What I want to achieve here is a simple buoyancy effect where the ball chases after the line but bobbles up and down a little before settling on the line
In the example code below the ball simply chases after the line (controlled by the mouse)
Any simple methods?
I tried using a Sin() method but things get jumpy/messy

In the example code below the ball simply chases after the line (controlled by the mouse)
Any simple methods?
I tried using a Sin() method but things get jumpy/messy

' buoyancy v1.1 SuperStrict Framework BRL.GLMax2D ' Setup & initialise variables Const SW% = 640, SH% = 400 ' display settings AppTitle="Simple Buoyancy" SetGraphicsDriver GLMax2DDriver() Graphics sw,sh,0,40 SetClsColor $40,$80,$cf MoveMouse SW/2,SH/2 Const buoyMAX#=24.0 Const buoySTRENGTH#=1.025 Const bX%=100 Global oby# , my# oby=MouseY() Global buoy#=5.0 , count% While Not KeyHit(KEY_ESCAPE) Cls count:+1 ; buoy:/buoySTRENGTH my=MouseY() If Abs(my-oby)>buoy Then buoy=Abs(my-oby) If buoy>buoyMAX Then buoy=buoyMAX oby:+(my-oby)/4.0 ' base line SetColor $20,$ff,$ff DrawLine 0,my,SW,my ' ball SetColor $ff,$fc,$80 DrawOval bX-20,oby-20+Sin(count*10)*buoy,40,40 ' connection line SetColor 0,0,0 DrawLine bX,oby+Sin(count*10)*buoy , bX,my Flip Wend End
