Fire EffectΒΆ

Copyright 2023 Ethan Christensen

Licensed under the Apache License, Version 2.0 (the β€œLicense”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an β€œAS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

class bruhanimate.bruheffect.fire_effect.FireEffect(buffer: Buffer, background: str)[source]ΒΆ

Bases: BaseEffect

Class for generating a dynamic, improved fire effect with taller, rounder, and more visible flames using fuller ASCII characters.

__init__(buffer: Buffer, background: str)[source]ΒΆ

Initializes the enhanced fire effect with a buffer and a background string.

set_fire_ascii_chars(ascii_chars: str)[source]ΒΆ

Set the ASCII characters used for the fire effect.

set_fire_intensity(fire_intensity: float)[source]ΒΆ

Sets the intensity of the fire effect.

set_fire_wind(direction: float, strength: float)[source]ΒΆ

Sets wind parameters for the fire effect.

set_fire_use_char_color(use_char_color: bool)[source]ΒΆ

Enables or disables the use of character color for the fire effect.

set_fire_background_color(background_color: bool)[source]ΒΆ

Enables or disables the background color for the fire effect.

set_fire_swell(swell: bool, swell_halt: int = 1)[source]ΒΆ

Controls the swell effect for the fire.

set_fire_turbulence(turbulence: float)[source]ΒΆ

Sets how chaotic the fire behaves.

set_fire_heat_spot_intensity(heat_spot_intensity: float)[source]ΒΆ

Sets the intensity of heat spots for the fire effect.

get_colored_char(intensity: float, max_intensity: float = 255.0) str[source]ΒΆ

Returns a colored character for the fire effect based on its intensity.

update_data(frame_number: int)[source]ΒΆ

Updates the fire effect data with logic for taller and rounder flames.

add_new_fire_row(frame_number: int)[source]ΒΆ

Adds a new row to the fire effect.

render_frame(frame_number: int)[source]ΒΆ

Renders the current frame of the fire effect.