SetOnGenSpriteStatsSub


SetOnGenSpriteStatsSub sprite, onSpriteStats()

Sets the on sprite stats changed subroutine for the specified sprite. Once set, the specified onSpriteStats() subroutine will be automatically called when the sprite's stats change. Stats include a sprite's hit points and shield points.



include "Game Engine Constants.inc"

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

SetOnGenSpriteStatsSub sprite, onSpriteStats()

'...continue with program...

Sub onSpriteStats(sprite, type)

End Sub


sprite

The Game Engine sprite object. This is the sprite that triggered the event sub.


type

The type indicates what event triggered the sub call.

From the Game Engine Constants.inc file. This include file is located in the global include directory and may be used by any Basic program.


' Sprite Stats Event Sub Types
Const Stat_Hit_Points_Zero = 1
Const Stat_Shield_Points_Zero = 2


SetOnGenSpriteStatsSub sprite, Off

Turns off the automatic subroutine call.


GenIncSpriteHitPoints


GenIncSpriteShieldPoints


GenSetSpriteCollision


GenSetSpriteHitPoints


GenSetSpriteInvulnerable


GenSetSpriteMass


GenSetSpriteMaxHitPoints


GenSetSpriteMaxShields


GenSetSpriteShieldPoints


GenSetSpriteShields


Game Engine Events


Event Triggered Subs






Become a Patron