Something like this should work:
#constant maxAsteroids 99
type spriteID
asteroid as integer[maxAsteroids]
ship as integer
endType
type asteroidObject
x as integer
y as integer
frame as integer
state as integer
endType
type shipObject
x as integer
y as integer
frame as integer
state as integer
endType
sprite as spriteID
asteroid as asteroidObject[maxAsteroids]
ship as shipObject
// populate the datatypes with default values
// in some function you squirrel away somewhere
index = 1
do
moveShip(sprite, ship)
moveAsteroids(sprite, asteroid)
collision(sprite, index, asteroid, ship)
loop
function collision( spr as spriteID,
index as integer,
asteroid ref as asteroidObject[],
ship ref as shipObject)
if getSpriteCollision(spr.asteroid[index], spr.ship) = 1
// do stuff with asteroid
// do stuff with ship
endIf
endFunction
Basic premise is that the spriteIDs are stored in one datatype and then the object itself in another. If several of one type, you just make an array out of both the spriteID variable and the object datatype - and add a pointer to it in some kind of control structure.
edit: And yes, the reason you got the error message is that you defined your function without explicitly telling it what type of data it will receive. AppGameKit then just assume you want an integer.
So for instance function doStuff(object1, object2) is the same as function doStuff(object1 as integer, object2 as integer). To pass a datatype, you need to declare it explicitly as in my example above.