Challenge:
Version:
(Version A)
Winner?:
No
Code Snippet:
Rem Test Type Coordinates x as Float y as Float z as Float EndType Global Object as Coordinates Global Target as Coordinates m# = 10.0 :` mass R# = 20 :` resting Y length K# = 0.6 :` spring coefficient v# = 0.0 :` velocity f# = 0.98 :` friction Make Object Cylinder 1,1 Scale Object 1,100,2000,100 Position Object 1,0,0,50 repeat y#=Object Size Y(1) if mouseclick() y# = y# - MouseMoveY() else flag = 0 force# = -k# * (y#-R#) v# = (v# + force#/m#)*f# y# = y# + v# endif Scale Object 1,100,y#*100,100 Return_Object(1) Position Object 1,Object.x,(y#-R#)/2.0,Object.z set cursor 0,0 print "force: ",force# print "Size: ",y# sync until spacekey() Function Return_Object(ObjectID) Object.x=Object Position X(ObjectID):Object.y=Object Position Y(ObjectID):Object.z=Object Position Z(ObjectID) EndFunction Function Return_Target(TargetID) Target.x=Object Position X(TargetID):Target.y=Object Position Y(TargetID):Target.z=Object Position Z(TargetID) EndFunction