Tasmota/lib/libesp32/berry_animation/anim_examples/compiled/comet_chase.be
2025-08-01 23:19:24 +02:00

93 lines
3.0 KiB
Plaintext

# Generated Berry code from Animation DSL
# Source: comet_chase.anim
# Generated automatically
#
# This file was automatically generated by compile_all_dsl_examples.sh
# Do not edit manually - changes will be overwritten
# Original DSL source:
# # Comet Chase - Moving comet with trailing tail
# # Bright head with fading tail
#
# strip length 60
#
# # Dark blue background
# color space_blue = 0x000066 # Note: opaque 0xFF alpha channel is implicitly added
# animation background = solid(space_blue)
#
# # Main comet with bright white head
# animation comet_main = comet_animation(
# 0xFFFFFF, # White head
# 10, # tail length
# 2s # speed
# )
# comet_main.priority = 7
#
# # Secondary comet in different color, opposite direction
# animation comet_secondary = comet_animation(
# 0xFF4500, # Orange head
# 8, # shorter tail
# 3s, # slower speed
# -1 # other direction
# )
# comet_secondary.priority = 5
#
# # Add sparkle trail behind comets but on top of blue background
# animation comet_sparkles = twinkle_animation(
# 0xAAAAFF, # Light blue sparkles
# 8, # density (moderate sparkles)
# 400ms # twinkle speed (quick sparkle)
# )
# comet_sparkles.priority = 8
#
# # Start all animations
# run background
# run comet_main
# run comet_secondary
# run comet_sparkles
import animation
# Comet Chase - Moving comet with trailing tail
# Bright head with fading tail
var engine = animation.init_strip(60)
# Dark blue background
var space_blue_ = 0xFF000066 # Note: opaque 0xFF alpha channel is implicitly added
var background_ = animation.solid(animation.global('space_blue_', 'space_blue'))
# Main comet with bright white head
var comet_main_ = animation.comet_animation(0xFFFFFFFF, 10, 2000)
animation.global('comet_main_').priority = 7
# Secondary comet in different color, opposite direction
var comet_secondary_ = animation.comet_animation(0xFFFF4500, 8, 3000, -1)
animation.global('comet_secondary_').priority = 5
# Add sparkle trail behind comets but on top of blue background
var comet_sparkles_ = animation.twinkle_animation(0xFFAAAAFF, 8, 400)
animation.global('comet_sparkles_').priority = 8
# Start all animations
# Start all animations/sequences
if global.contains('sequence_background')
var seq_manager = global.sequence_background()
engine.add_sequence_manager(seq_manager)
else
engine.add_animation(animation.global('background_'))
end
if global.contains('sequence_comet_main')
var seq_manager = global.sequence_comet_main()
engine.add_sequence_manager(seq_manager)
else
engine.add_animation(animation.global('comet_main_'))
end
if global.contains('sequence_comet_secondary')
var seq_manager = global.sequence_comet_secondary()
engine.add_sequence_manager(seq_manager)
else
engine.add_animation(animation.global('comet_secondary_'))
end
if global.contains('sequence_comet_sparkles')
var seq_manager = global.sequence_comet_sparkles()
engine.add_sequence_manager(seq_manager)
else
engine.add_animation(animation.global('comet_sparkles_'))
end
engine.start()