Hit Effects and Dust Effects
Hit Effects[edit | edit source]
Hit effects are animations that play in a specific position for a set amount of time using the hit_fx_obj
. The game has many built-in visual effects, but you can also create your own. A full list of hit effects can be found on a the Visual Effects page.
You can create an effect from a custom sprite using hit_fx_create( sprite_index, animation_length )
→ and then either assign it to the hitbox grid with the grid index HG_VISUAL_EFFECT
or manually spawn it using spawn_hit_fx( x, y, hit_fx_index )
→
Variables[edit | edit source]
Variable | Description |
---|---|
hit_angle
|
The angle at which to draw the effect. |
hit_fx
|
The index of the hit effect. |
hit_length
|
The total lifetime the hit effect has. The effect will destroy itself when step_timer reaches this value.
|
hit_player
|
The player slot of the player who got hit by the owner of this hit effect. |
draw_angle
|
The angle at which to draw the effect.
Certain base effects with multiple layers, mainly the generic hit effects, will not have their secondary layer rotated when manually changing its draw_angle. |
follow_id
|
ID of an object instance (usually noone ) this effect follows. If it exists, the hit effect's position will be set to this instance's position every frame.
|
follow_time
|
If above 0 , number of frames the hit effect will follow the position of the follow_id instance.
Otherwise, position will always be set to |
grav
|
The downward acceleration applied to the hit effect every frame. |
hsp
|
Horizontal speed of the effect, in pixels per frame. |
vsp
|
Vertical speed of the effect, in pixels per frame. |
image_length
|
How many frames the sprite strip is split into. |
kb_dir
|
The direction of knockback from the hit player, applied to the hit effect. Used by certain angled effects. |
kb_speed
|
The strength of the knockback from the hit player, applied to the hit effect. Unknown. |
pause
|
The amount of frames to pause when you set pause_timer to 0 . Does not seem to work.
|
pause_timer
|
Set to 0 to pause the effect.
|
player
|
Player slot that created this hit effect. |
player_id
|
ID of the player instance that created this hit effect. Determines who's shaders will apply on the hit effect, can be set to noone to draw without shading.
|
select
|
Unknown. |
spr_dir
|
The direction the effect is facing.
|
start_frame
|
Overrides itself to 0 the first frame the effect exists. If forced to a number after this, the effect will skip to the equal image_index and consider it as the starting frame of the animation. However, the animation will still try to go through image_length amount of frames, causing it to loop.
|
step_timer
|
The number of frames that this hit effect has been active. Used to manage both animation progress and hit effect lifetime. |
uses_shader
|
Determines what kind of shading is applied on this hit effect.
|
white
|
ID of an associated hit_fx_white_obj instance. Used by many base effects to affect their secondary layer.
When the hit effect is destroyed, any entity set to this value will be destroyed as well. |
burned
|
Used by Zetterburn. Unknown. |
gameboy_shock
|
Related to the Early Access alt. Unknown. |
Dust Effects[edit | edit source]
Dust effects are animations that play in a specific position for a set amount of time using asset_get( asset )
→ with the new_dust_fx_obj
object. The game has many built-in visual effects, and most of these have a foreground and background sprite. Many are automatically played during certain situations such as dashing, stopping, jumping, wavelanding, teching, bouncing, being knocked away, etc.
Dust effects can be manually spawned using spawn_dust_fx( x, y, sprite_index, length )
→. Unlike hit effects, dust effects animate sprites directly instead of assigning them to a list first.
Variables[edit | edit source]
Variable | Description |
---|---|
dust_color
|
Unknown. |
dust_depth
|
Assumed to be related to the depth at which the dust is drawn, but it is not fully understood. |
dust_fx
|
The index of the dust effect. |
dust_length
|
The total lifetime the dust effect has. The effect will destroy itself when step_timer reaches this value.
|
draw_angle
|
The angle at which to draw the effect. |
fg_index
|
The sprite_index of the foreground dust connected to the dust effect. If the effect has no attached sprite, it is set to -1 .
|
hsp
|
Horizontal speed of the effect, in pixels per frame. |
vsp
|
Vertical speed of the effect, in pixels per frame. |
init
|
True when the effect has been initialized. Setting this to 0 will make the effect initialize itself again. |
player
|
Player slot that created this dust effect. Notably, it is the attacker who spawns basegame dust effects onto the victim when they are sent flying or collide with a block. |
player_id
|
ID of the player instance that created this dust effect. Determines who's shaders will apply on the dust effect, can be set to noone to draw without shading.
|
spr_dir
|
The direction the effect is facing.
|
step_timer
|
The number of frames that this dust effect has been active. Used to manage both animation progress and dust effect lifetime. |
shader_init
|
Unknown. |