> For the complete documentation index, see [llms.txt](https://docs.moddingofisaac.com/ab_p/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.moddingofisaac.com/ab_p/beta/docs/functions.md).

# Class "Global Functions"

## Constructors

### [Game](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Game/README.md) () {: aria-label='Constructors' }

[ ](/ab_p/beta/docs/functions.md){: .abp .tooltip .badge }

#### [Game](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Game/README.md) [Game](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Game/README.md) ( ) {: .copyable aria-label='Constructors' }

Returns a [Game](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Game/README.md) object.

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

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

### [MusicManager](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/MusicManager/README.md) () {: aria-label='Constructors' }

[ ](/ab_p/beta/docs/functions.md){: .abp .tooltip .badge }

#### [MusicManager](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/MusicManager/README.md) [MusicManager](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/MusicManager/README.md) ( ) {: .copyable aria-label='Constructors' }

Returns a [MusicManager](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/MusicManager/README.md) object.

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

```lua
    MusicManager():Disable()
```

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

[ ](/ab_p/beta/docs/functions.md){: .abp .tooltip .badge }

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

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

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

[ ](/ab_p/beta/docs/functions.md){: .abp .tooltip .badge }

#### [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) RandomVector ( ) {: .copyable aria-label='Constructors' }

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

### [SFXManager](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/SFXManager/README.md) () {: aria-label='Constructors' }

[ ](/ab_p/beta/docs/functions.md){: .abp .tooltip .badge }

#### [SFXManager](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/SFXManager/README.md) [SFXManager](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/SFXManager/README.md) ( ) {: .copyable aria-label='Constructors' }

Returns a [SFXManager](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/SFXManager/README.md) object.

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

```lua
    SFXManager():Stop(SoundEffect.SOUND_1UP)
```

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

[ ](/ab_p/beta/docs/functions.md){: .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.

```lua
    -- don't do it like this
    if entity1 == entity2 then
    -- this will always be false, because two different references on a pointer are not equal
    end
    -- use GetPtrHash() to compare them
    if GetPtrHash(entity1) == GetPtrHash(entity2) then
    -- this will be true, when the pointer of both variables point to the same object.
    end
```
