Skip to content

Instantly share code, notes, and snippets.

@shifterbit
shifterbit / meterMask.hx
Created April 17, 2025 20:40
sample code to make use of masks for meters in fraymakers
function createMeter() {
// For the foreground and background sprites, we can use either sprites or vfxs, really doesnt matter
var resource = self.getResource().getContent("meter");
Engine.log(resource);
var meterBackgroundSprite = Sprite.create(resource);
meterBackgroundSprite.currentAnimation = "meterBackground";
var meterBackgroundVfx = match.createVfx(new VfxStats({ spriteContent: resource, animation: "meterBackground", loop: true }), null);
// This is for your filled meter Sprite(This can also be a vfx if you wish)
var meterFullSprite = Sprite.create(resource);
function createHSBCFilterToTarget(color: Int, targetColor: Int): HsbcColorFilter {
var hsbBase = RGBtoHSV(hexToRGB(color));
var hsbTarget = RGBtoHSV(hexToRGB(targetColor));
// I May or may have fumbled this section for brightness and contrast but it should work probably maybe possibly
var difference = {
hue: hsbTarget.h - hsbBase.h,
saturation: hsbTarget.s - hsbBase.s,
brightness: (hsbTarget.v - hsbBase.v) / 255,
};
difference.hue = (Math.isNaN(difference.hue)) ? 0 : difference.hue;
@shifterbit
shifterbit / TextGenerationCode.hx
Last active December 27, 2024 05:52
Fraymakers Text Generation Code
function createColorShader(color) {
var shader = new RgbaColorShader();
shader.color = color;
shader.redMultiplier = 1 / 3;
shader.greenMultiplier = 1 / 2;
shader.blueMultiplier = 1;
return shader;
}
function disposeSprites(textSprites: Array<Sprite>) {
@shifterbit
shifterbit / FraymakersTextGeneration.md
Last active December 1, 2024 20:46
How to generate text on screen in Fraymakers

Prerequisites

A projectile entity, with no hitboxes or hurtboxes, and an empty sprite for the animation frames(basically it should be invisible and not interactable) Font Sprites and Entity.

The Code

At the in your script file add the following variable, make sure it is outside any functons such as initialize(), update() onTeardown() etc

var globalDummy: Projectile = null;

Predicting The Fatality of a Move in Fraymakers

Calculating distance from deathbounds

function distanceFromDeathBounds(entity: Entity, components: {x: Float, y: Float}) {
    var deathBounds = stage.getDeathBounds();
    var r = deathBounds.getRectangle();
    var width = r.width;
    var height = r.height;
    var top = deathBounds.getY(); // top
@shifterbit
shifterbit / ssf2linux.md
Last active June 20, 2025 02:34
Installing Super Smash Flash 2 on Linux/Steam Deck

RUNNING DIRECTLY THROUGH STEAM(EASIEST METHOD)

Downloading and Extracting SSF2

If you use a 64 bit System(Steam Deck Users, Desktop Linux Users), Make sure you the Windows 64-bit portable version of Super Smash Flash 2 downloaded and extracted into its own folder.

  • If you use a 32-bit System, Make sure you the Windows 32-bit portable version of Super Smash Flash 2 downloaded
  • Extract The portable version into a folder somewhere.

Adding SSF2 to Steam

Click Add a Game at the bottom left corner of the steam window

image