Elastic physics algorithm

Blitz3D Forums/Blitz3D Programming/Elastic physics algorithm

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I added this to GetInput()

B3D
	If KeyDown( 57 )
		p.particle = player\point
		p\x = 512	;because screen is 1024 x 768
		p\y = 384
	EndIf

BMax
	If KeyDown(key_space)
		p:particle = tmpplayer.point
		p.x = 512
		p.y = 384
	EndIf


In case the triangle gets lost (happens often enough when playing with different parameters) keep space pressed until things have calmed down.

Very useful Code snippet that you found, Stevie G - thanks!