image collision/deletion problem

Blitz3D Forums/Blitz3D Beginners Area/image collision/deletion problem

Hmmm, i've had a look see. This bit seems to be a bit odd. You using variables to offset the positioning of the bullets and aliens. now:

	For enemy.enemy=Each enemy
		If enemy\alive <>0 Then DrawImage (enemy\image,enemy\x+boardxstart,enemy\y+boardystart,enemy\imagehandle)
	Next
	
	;draw bullets
	For bullet.bullet=Each bullet
		If bullet\alive <>0 Then DrawImage (bullet\image,bullet\x+boardxstart,bullet\y+tilewidth,bullet\imagehandle)
		Rect bullet\x+boardxstart,bullet\y+tilewidth,1,1
	Next


you use "tilewidth" to position the Y of the bullets, BUT, you use boardYstart to position the aliens. Now, your basically drawing them in one position and checking the collisions is different positions.

Basically, it's the draw bullets line that mucking it up. It should be:

	;draw bullets
	For bullet.bullet=Each bullet
		If bullet\alive <>0 Then DrawImage (bullet\image,bullet\x+boardxstart,bullet\y+boardystart,bullet\imagehandle)
	Next


Note, the change is using the variable "boardystart" to position the bullet on the Y axis. :o)