Collision Problem

BlitzPlus Forums/BlitzPlus Programming/Collision Problem

ShaunVonSuffern(Posted 2008) [#1]
In my game one, when one ship collides with a player ship, the player loses one hp and the enemy ship resets position randomly. This works perfectly when the enemy ship hits the left side of the ship, but when it hits the right side of the playership, nothing happens. What do i need to change?
Here the code snippet for collisions:



Cp(Posted 2008) [#2]
Use images its easier
Text is too hard
playerimage = LoadImage("player.bmp");load like that

If ImagesOverlap(player\pic,player\x,player\y,enemy\pic,enemy\x,enemy\y); this tests for collisions
enemy\x = Rand(1,640)
enemy\y = Rand(1,480)
player\hitpoints = player\hitpoints - 1
If player\hitpoints <= 0 Then DeathScreen()
EndIf ; Use that for collisions