Skip to content

Instantly share code, notes, and snippets.

View shimeji87's full-sized avatar

shimeji87 shimeji87

View GitHub Profile
@shimeji87
shimeji87 / hbi.pl
Last active April 9, 2023 08:21
Haxelib Bulk Install
#! /usr/bin/perl
# Haxelib Bulk Install
# Install from git - [name] [github repo]
# Update library - [name] update
# Set library version - [name] set [version]
# Remove library - [name] remove/delete/del
use LWP::Simple;
use strict;
// VARIABLES
var hologramColorInput:FlxUIInputText;
// UI INITIALIZATION
hologramColorInput = new FlxUIInputText(120, 200, 100, "", 8);
hologramColorInput.focusLost = () -> {
FlxG.save.data.hologramColor = ClientPrefs.chartingHologramColor = Std.parseInt('0xFF' + hologramColorInput.text.replace('#', ''));
dummyArrow.color = FlxG.save.data.hologramColor;
}
@shimeji87
shimeji87 / FNFChartingUndoRedo.hx
Created December 26, 2022 01:57
The shit needed for undo/redo implementation in FNF's charting state
enum abstract ChartActionType(Int) from Int to Int {
var AddNote:Int = 0;
var RemoveNote:Int = 1;
var AddEvent:Int = 2;
var RemoveEvent:Int = 3;
}
typedef ChartAction = {
var action:ChartActionType;
var data:Dynamic;
}
@shimeji87
shimeji87 / Ray.hx
Created November 3, 2022 07:08
Ray class in haxe
package;
import flixel.math.FlxPoint;
import flixel.math.FlxRect;
import flixel.math.FlxVector;
import haxe.ds.Vector;
class Ray
{
public var start:FlxPoint;
@shimeji87
shimeji87 / SimpleString.cpp
Created October 30, 2022 18:16
Simple string class in c++
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
class SimpleString {
public:
SimpleString(const char* text) {
raw_str = (char**)malloc((size_t)(sizeof(const char*) * strlen(text)));
strcpy(*raw_str, text);
@shimeji87
shimeji87 / Bitfield.hx
Last active September 23, 2022 22:57
A abstract that allows you to use an integer as a bitfield.
abstract Bitfield(Int) from Int to Int
{
inline public function new(num:Int)
{
this = num;
}
public inline function setBit(n:Int)
{
this |= 0x1 << n;
package;
import flixel.FlxCamera;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.util.FlxColor;
class CoolCamera
{
public static var camera1:FlxCamera;
@shimeji87
shimeji87 / AABB.hx
Created October 4, 2021 06:27
AABB collision I coded although it's useless since FlxG.collide() exists
package;
import flixel.FlxG;
import flixel.FlxObject;
class AABB extends FlxObject
{
var collider:FlxObject;
var isColliding:Bool;
@shimeji87
shimeji87 / NoiseShader.hx
Created September 30, 2021 15:25
noise shader/tv static shader
package;
import flixel.system.FlxAssets.FlxShader;
// creds to shadertoy for the shader
// creds to halfbuzz for helpin with excluding transparency
class NoiseShader extends FlxShader {
@:glFragmentSource("
#pragma header
@shimeji87
shimeji87 / Conductor.hx
Created September 13, 2021 23:08
A beat event system/Conductor in HaxeFlixel
package;
import flixel.FlxG;
using Math;
using flixel.math.FlxMath;
class Conductor
{
public static var bpm:Int = 100;