Sub Player_OnSpritesCollide(Name, ClsASprIdx, ClsBSprIdx, CollDefIdx)
Dim Spr1, Spr2
With ProjectObj.GamePlayer.rMap.MapLayer(ProjectObj.GamePlayer.PlayerSprite.rDef.rLayer)
Spr1 = .Sprite(ClsASprIdx)
Spr2 = .Sprite(ClsBSprIdx)
End With
Dim Spr1Name, Spr2Name
Spr1Name = Spr1.rDef.Name
Spr2Name = Spr2.rDef.Name
If Spr1Name = "Sword" and Spr2Name = "Boss" then
'Code here
End If
End Sub
As for using variables, just use "dim x" like this:
Sub SomeRandomSubFunction(Sprite)
Dim x, spr
set sprT = Sprite.Template 'use Set instead of Let since it's an object, not a number
x = ((1 + (25 - sprT.AnimSpeed)) * sprT.StateFrameCount(0)) - 1
doSomethingWithVariable(x) 'Pass it to another function as a number.
End Sub