Creates a hitbox that instantly K.O.s any player that touches it.
Argument | Type | Description |
---|---|---|
x | :real | The x coordinate of the center of the deathbox's desired position |
y | :real | The y coordinate of the center of the deathbox's desired position |
w | :real | The width of the deathbox, in pixels |
h | :real | The height of the deathbox, in pixels |
player | :real | Used to make the deathbox only hit a specific player. Set to -1 if you want it to be able to hit all players. Set to 0 if you want it to be able to hit all players except yourself |
free | :real | If set to false, it will only hit grounded players |
shape | :real | The sprite to use for the deathbox (same as the HG_SHAPE property in the hitbox grid): 0 = circle 1 = rectangle 2 = rounded rectangle |
lifespan | :real | The number of frames the deathbox stays active |
bg_type | :real | [optional] The screen effect to play when the deathbox hits someone: 0 = no screen effect 1 = purple screen effect 2 = red screen effect |
Example, called from attack_update.gml:
// this attack creates a deathbox on top of the player that was hit by an earlier hitbox of the attack. This deathbox can only kill the hit player and will show the red screen effect on hit:
if (window == 3 && window_timer == 10 && has_hit_player) {
create_deathbox(
has_hit_id.x, // x
has_hit_id.y, // y
100, // w
100, // h
has_hit_id.player, // player
true, // free
1, // shape
3, // lifespan
2 // bg_type
);
}