Skip to content

05_VISUAL_EFFECTS

Orel138 edited this page Sep 1, 2024 · 1 revision

5. Visual Effects

This chapter focuses on adding visual effects to your custom wand, enhancing its magical appearance and making it stand out in the game world. We'll cover particle effects, glowing, and other visual enhancements.

Particle Effects

Particle effects can make your wand look more magical or emphasize its elemental nature. These effects are added using the SpriteParticleEmitterComponent in your wand's entity XML file.

Basic Particle Effect

Here's a basic example of a particle effect that creates a subtle magical aura around the wand:

<SpriteParticleEmitterComponent
    sprite_file="data/particles/ray.xml" 
    delay="0"
    lifetime="1.5"
    color.r="1" color.g="1" color.b="1" color.a="0.5"
    color_change.r="0" color_change.g="0" color_change.b="0" color_change.a="-0.5"
    velocity.x="0" velocity.y="0"
    gravity.x="0" gravity.y="0"
    velocity_slowdown="0"
    rotation="0"
    angular_velocity="0"
    scale.x="1" scale.y="0"
    scale_velocity.x="-0.2" scale_velocity.y="4"
    emission_interval_min_frames="3"
    emission_interval_max_frames="6"
    emissive="1"
    additive="1"
    count_min="1" count_max="1"
    use_velocity_as_rotation="1"
    randomize_position.min_x="-5"
    randomize_position.max_x="5"
    randomize_position.min_y="-5"
    randomize_position.max_y="5"
    randomize_velocity.min_x="-30"
    randomize_velocity.max_x="30"
    randomize_velocity.min_y="-30"
    randomize_velocity.max_y="30"
    velocity_always_away_from_center="1">
</SpriteParticleEmitterComponent>

Customizing Particle Effects

  • sprite_file: Change this to use different particle sprites. Noita provides many options in the data/particles/ directory.
  • color and color_change: Adjust these to change the particle color and how it fades over time.
  • velocity and gravity: Modify these to change how particles move.
  • scale and scale_velocity: Adjust the size of particles and how they grow or shrink over time.
  • emission_interval and count: Control how often particles spawn and how many spawn at once.

Combining Effects

You can combine multiple effects to create a unique look for your wand.

Performance Considerations

While visual effects can make your wand look amazing, be mindful of performance. Too many particles or complex effects can slow down the game, especially if many of these wands are present at once.

In the next chapter, we'll explore some advanced features and techniques to further customize your wand's behavior and interactions within the game world.

Clone this wiki locally