Finish Line end on intersection

Blitz3D Forums/Blitz3D Beginners Area/Finish Line end on intersection

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.


for bullet.bullet = each bullet
drawimage(bullet_image,bullet\x,bullet\y)
if imagescollide(bullet_image,bullet\x,bullet\y,bullet_image,bulletx,bullety)
print "collision!"
endif
bullet\x=bulletx
bullet\y=bullety
next



That's a pretty bad example as your only comparing the previous bullet coords to the current.

For b.bullet = Each bullet
	c.bullet = b
	While c <> Last bullet
		c = After c
		If ImagesCollide( bullet_image, b\x, b\y, Frame, bullet_image, c\x, c\y, Frame )
			;Handle collision
		EndIf
	Wend
Next


This method ensures that you only check each pair once.

@ Fuller, If you want help with your routines - post what code you have.

Stevie