» Uncategorized Posts

set_victory_theme

Overwrites character’s victory theme. Can be assigned to a custom sound using

sound_get( sound )  Reference→

or set to one of the following indexes

ArgumentTypeDescription
theme:realVictory theme index or custom sound ID

Example, called from load.gml:

set_victory_theme( sound_get( "custom" ));

sound_stop

Stops the specified sound if it’s playing.

Use either

asset_get( sound )  Reference→
sound_get( sound )  Reference→

to retrieve the ID.

ArgumentTypeDescription
soundID:realThe ID of the game sound to stop

Example, called from attack_update.gml:

// this attack plays a charging sound that stops when you release the charge:
if (window == 3 && window_timer == 1) {
sound_stop(sound_get( "charging_sound" ));
sound_play(sound_get( "release_sound" ));
}

sound_play

Plays the specified sound effect, supports both built-in and custom sounds. Returns the id of the sound played.

Use either

asset_get( sound )  Reference→ sound_get( sound )  Reference→

to retrieve the ID.

ArgumentTypeDescription
soundID:realThe ID of the game sound to play
looping:real(optional)
Whether to loop the sound or not. If set to true, be sure to save the id of the sound so you can later stop it with sound_stop( sound ) Reference→
panning:real(optional)
The panning of the sound. Should be between -1 and 1. Using the keyword noone will use normal panning.
volume:real(optional)
The volume of the sound. Should be between 0 and 1.
pitch:real(optional)
The pitch of the sound, in multiples. 2 will play the sound at double pitch, 0.5 at half pitch, and so on.

Example, called from attack_update.gml:

if (attack == AT_NSPECIAL) {
if (window == 4 && window_timer == 1) {
sound_play( sound_get( "custom" ) );
}
}

sound_get

Returns the unique index (real) of the sound asset loaded from the /sounds folder (should be in .ogg format).

ArgumentTypeDescription
sound:stringThe name of the sound to get the index of

Example, called from ustrong.gml:

// sets the sound assigned to the first ustrong hitbox:
set_hitbox_value( AT_USTRONG, 1, HG_HIT_SFX, sound_get( "custom" ));

sprite_change_collision_mask

Updates collision mask properties of the sprite asset loaded from the /sprites folder.

ArgumentTypeDescription
sprite:stringThe name of the sprite to set the bounding box of
sepmasks:realWhether to create collision masks for each sub-image of the sprite (true) or one mask for all (false)
bboxmode:realThe kind of bounding box:
0 = automatic
1 = full image
2 = user defined
bbleft:realThe maximum left position of the bounding box
bbtop:realThe maximum top position of the bounding box
bbright:realThe maximum right position of the bounding box
bbbottom:realThe maximum bottom position of the bounding box
kind:realThe kind of mask:
0 = precise
1 = bounding box
2 = disk
3 = diamond

Example, called from init.gml:

// changing offset of the jump sprite to [94, 138]:
sprite_change_offset( "jump", 94, 138 );
// making it precise:
sprite_change_collision_mask( "jump", true, 0, 0, 0, 0, 0, 0 );