Class "Global Functions"

Constructors

Game () {: aria-label='Constructors' }

{: .abp .tooltip .badge }

Game Game ( ) {: .copyable aria-label='Constructors' }

Returns a Game object.

???- example "Example Code" Example usage:

    Game():IsPaused()
    --returns true if the game is paused

MusicManager () {: aria-label='Constructors' }

{: .abp .tooltip .badge }

MusicManager MusicManager ( ) {: .copyable aria-label='Constructors' }

Returns a MusicManager object.

???- example "Example Code" Example usage:

    MusicManager():Disable()

Random () {: aria-label='Constructors' }

{: .abp .tooltip .badge }

int Random ( ) {: .copyable aria-label='Constructors' }

Returns a random integer. (0 to 2^32)

RandomVector () {: aria-label='Constructors' }

{: .abp .tooltip .badge }

Vector RandomVector ( ) {: .copyable aria-label='Constructors' }

Returns a random vector with length 1. Multiply this vector by a number for larger random vectors.

SFXManager () {: aria-label='Constructors' }

{: .abp .tooltip .badge }

SFXManager SFXManager ( ) {: .copyable aria-label='Constructors' }

Returns a SFXManager object.

???- example "Example Code" Example usage:

GetPtrHash () {: aria-label='Constructors' }

{: .abp .tooltip .badge }

int GetPtrHash ( Objectobject ) {: .copyable aria-label='Constructors' }

Returns a hash-value of the pointer given as an input value. Valid inputs are any Isaac object, including :::lua Entity, :::lua Room, :::lua RNG, :::lua Sprite, :::lua Game etc.

It can be used to easily compare two entities, making equality checks very easy.

Example:

If you spawn a certain entity, save it in a variable and then compare it to the :::lua entity parameter in :::lua MC_ENTITY_TAKE_DMG, this comparison will never be true even if both variables refer to the exact same entity in the game. :::lua GetPtrHash() turns pointer into a fixed number, which makes comparisons easier.

???- example "Example Code" Example on check if two entities saved in different variables are the same.

Last updated

Was this helpful?