Using the 'Onscreen Image' in collisions

BlitzPlus Forums/BlitzPlus Programming/Using the 'Onscreen Image' in collisions

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.

Not exactly Rico, but there are workarounds. Try this out.

ship = LoadImage("spaceship.bmp")

collision = CheckCollision( BackBuffer(), ship, playerX, playerY )

Function CheckCollision( buffer, image, x, y, frame=0 )
	img = CreateImage(GraphicsWidth(), GraphicsHeight())
	CopyRect 0, 0, GraphicsWidth(), Graphicsheight(), buffer, 0, 0, ImageBuffer(img)
	val = ImagesCollide( image, x, y, frame, img, 0, 0, 0)
	FreeImage img
	Return val
End Function

Although it uses a seperate image it is a self-contained function so shouldnt intrude too much.