SetOnGenSpriteCollisionSub


SetOnGenSpriteCollisionSub sprite, onCollision()

Sets the on sprite collision subroutine for the specified sprite. Once set, the specified onCollision() subroutine will be automatically called when the sprite collides with another sprite on the same layer. If the sprite has the Omni-Collide mode set it will collide with sprites on all layers.



'...Turn on the game engine and init a sprite...

SetOnGenSpriteCollisionSub sprite, onCollision()

'...continue with program...

Sub onCollision(sprite1, sprite2)

End Sub


sprite1

This will be the sprite that detected the collision.


sprite2

This will be the sprite that collided with the first sprite.


SetOnGenSpriteCollisionSub sprite, Off

Turns off the automatic subroutine call.


GenSetSpriteCollision


GenSetSpriteOmniCollide


GenSetSpriteCollisionRadius


Game Engine Events


Event Triggered Subs






Become a Patron