Discord

Preparing your files

Please wait until the download is ready.

Luka's Scripting Utilities

Luka's Scripting Utilities

by Luka S.J.

A pack full of various scripting utilities to ease your development!

v4.1.135,194
Download144 KB

Special Sprites

Several ready-made Sprites::Base subclasses cover common animated-sprite
needs. Each one renders itself when you call update every frame.

Sprites::Scrolling

A sprite whose bitmap scrolls continuously — useful for backgrounds, conveyor
belts and parallax. Optionally pulses its opacity while scrolling.

  • scrolling.set_bitmap(path, vertical: false, pulse: false, speed: @speed) set the scrolling bitmap (returns self for chaining)
  • scrolling.update advance the scroll one frame

Accessors: speed, direction, vertical, pulse, min_o, max_o,
current_x, current_y.

bg = Sprites::Scrolling.new(viewport).set_bitmap("clouds", speed: 1.5)
# in the update loop:
bg.update

Sprites::Rainbow

A sprite that cycles its hue over time for a shifting rainbow effect.

  • rainbow.set_bitmap(path, speed: 1) set the bitmap and the per-frame hue-shift speed
  • rainbow.update advance the hue one frame

Sprites::Sheet

A spritesheet animator that steps through evenly divided frames of a sheet.

  • sheet.set_bitmap(file, frames: 1, vertical: false, speed: @speed) load a sheet of frames frames (laid out horizontally, or vertically with vertical: true); speed is the number of update ticks per frame
  • sheet.update advance the animation one tick
  • sheet.cur_frame the current frame index (read-only); sheet.speed ticks per frame

AnimatedPlane

AnimatedPlane is a Plane subclass that adds end_x / end_y accessors so a
scrolling plane's target offset can be tracked by the animation system.