Class "Global Functions"

Constructors

Gamearrow-up-right () {: aria-label='Constructors' }

{: .abp .tooltip .badge }

Gamearrow-up-right Gamearrow-up-right ( ) {: .copyable aria-label='Constructors' }

Returns a Gamearrow-up-right object.

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

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

MusicManagerarrow-up-right () {: aria-label='Constructors' }

{: .abp .tooltip .badge }

MusicManagerarrow-up-right MusicManagerarrow-up-right ( ) {: .copyable aria-label='Constructors' }

Returns a MusicManagerarrow-up-right 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 }

Vectorarrow-up-right RandomVector ( ) {: .copyable aria-label='Constructors' }

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

SFXManagerarrow-up-right () {: aria-label='Constructors' }

{: .abp .tooltip .badge }

SFXManagerarrow-up-right SFXManagerarrow-up-right ( ) {: .copyable aria-label='Constructors' }

Returns a SFXManagerarrow-up-right 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?