I tend to use Physics "sensor" sprites to get collision data, even for none physics based games as it gives you a little more to work with. If you use a "kinematic" sprite set up as a sensor as follows you can use it like any other sprite (not affected by gravity or collisions) but get more data from it.
spr = CreateSprite(img)
SetSpritePhysicsOn(spr, 3)
SetSpritePhysicsIsSensor(spr, 1)
I would use a User Defined Type for my player such as:
type playerType
spr as integer
health as float
collisions as integer[]
endtype
global player as playerType
Then fill the array once at the start of my player update function:
// empty the array
player.collisions.length = -1
// loop through collisions
coll = GetSpriteFirstContact(player.spr)
while coll>0
id = GetSpriteContactSpriteID2()
if GetSpriteCollision(player.spr, id)>0
player.collisions.insert(id)
endif
coll = GetSpriteNextContact()
endwhile
Then you can loop through the sprites that currently collide with your player as follows:
for i=0 to player.collisions.length
spriteID = player.collisions[i]
...do stuff to spriteID
next
Using AppGameKit V2 Tier 1