Skip to content

DCurrent/DC-Layer-Cycle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DC Layer Cycle

Fatal Fury Chronicles

Boilerplate Module

The DC Layer Cycle library enables modeless background animation in OpenBOR by defining and playing back sequences of layers.

It is designed for background effects that do not need full entity behavior. Instead of spawning models, the library cycles prepared fglayers by enabling the current layer and disabling the previous one. Because disabled layers are skipped by the renderer, inactive frames remain lightweight until needed.

Tutorial and Example Modules

Full tutorial documentation and example modules are available here:

Features

  • Layer-based animation sequences
  • Multiple independent animations per level
  • Fixed or random frame delays
  • Frame jumps and random jump ranges
  • Runtime layer property mutation
  • Automatic cleanup when the level ends

Basic Usage

Include the library from any script that will use it.

#include "data/scripts/dc_layer_cycle/main.c"

Call setup during the level create event, advance during the level update event, and clean up during the level destroy event.

void oncreate()
{
    dc_layer_cycle_setup(1, 11);

    dc_layer_cycle_frame_setup(0, 0, 0, 20);
    dc_layer_cycle_frame_setup(0, 1, 1, 20);
    dc_layer_cycle_frame_setup(0, 2, 2, 20);

    dc_layer_cycle_frame_setup(0, 10, 0, DC_LAYER_CYCLE_ACTION_GOTO);
}

void main()
{
    dc_layer_cycle_advance();
}

void ondestroy()
{
    dc_layer_cycle_cleanup();
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages