Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Kino KinoAR

🏠
Working from home
View GitHub Profile
@KinoAR
KinoAR / RMMVNodejs2-1.js
Created Dec 21, 2018
An example of Node.js copying using read/write file.
View RMMVNodejs2-1.js
//=============================================================================
// RMMVNodeP1.js
//=============================================================================
/*:
* @author PluginDev
* @plugindesc A plugin to read and write files using Node.js
*
*/
(function () {
@KinoAR
KinoAR / FlxSignalExample.hx
Last active Apr 19, 2022
An example of a FlxSignal in action.
View FlxSignalExample.hx
import flixel.util.FlxSignal;
// for signals that don't need data, use FlxSignal
var signal = new FlxSignal();
// for signals that need data, use FlxTypedSignal with the correct function type
var stringSignal = new FlxTypedSignal<String->Void>();
function noParamCallback() {
trace('Dispatched void event');
}
@KinoAR
KinoAR / json_minify.py
Last active Apr 7, 2022
A JSON minify script written in Python.
View json_minify.py
#!/usr/bin/env python3
"""JSON minify program. """
import json # import json library
import sys # import sys library
def minify(file_name):
"Minify JSON"
file_data = open(file_name, "r", 1).read() # store file info in variable
json_data = json.loads(file_data) # store in json structure
@KinoAR
KinoAR / InstanceExample.hx
Created Sep 4, 2021
An example of using instance properties in the Haxe programming language.
View InstanceExample.hx
// A class; a template for creating objects with the properties listed in the class
class Duck {
public var age:Int;
public function new(age:Int) {
this.age = age;
}
}
class Test {
@KinoAR
KinoAR / InstanceStaticExample.hx
Created Sep 4, 2021
A gist displaying how to use the static vs instance properties.
View InstanceStaticExample.hx
//A class; a template for creating objects with the properties listed in the class
class Duck {
static public var CAN_FLY:Bool = true;
public var age:Int;
public function new(age:Int) {
this.age = age;
}
}
@KinoAR
KinoAR / StructInitExampleCode.hx
Created Aug 31, 2021
Advanced Example of the power of Struct Init
View StructInitExampleCode.hx
//Test it out here: https://try.haxe.org/#5Fb7F1f4
class Test {
public static function main() {
// Uncomment this and see what happens
// var firstUser:Person = {
// name: 'Tim'
// };
// trace(firstUser.name);
var user:Test2 = {
@KinoAR
KinoAR / StructInit.hx
Created Aug 31, 2021
An example of Struct Init usage within the Haxe programming language.
View StructInit.hx
@:structInit class Person {
final name:String;
var age:Int = 30;
public function new(name:String, age:Int) {
this.name = name;
this.age = age;
}
public function greet()
View ElementalMonster.hx
/**
* ADTs take in a parameter as you can see here.
*/
enum ElementalAtk {
FireAtk(?dmg:Int);
WaterAtk(?dmg:Int);
LightningAtk(?dmg:Int);
MagnetoAtk(?dmg:Int);
IceAtk(?dmg:Int);
@KinoAR
KinoAR / ElementalADTs.hx
Created Jul 9, 2021
Advanced Enum Example
View ElementalADTs.hx
/**
* ADTs take in a parameter as you can see here.
*/
enum ElementalAtk {
FireAtk(?dmg:Int);
WaterAtk(?dmg:Int);
LightningAtk(?dmg:Int);
MagnetoAtk(?dmg:Int);
IceAtk(?dmg:Int);
@KinoAR
KinoAR / PluginPattern.js
Created Nov 3, 2016
A plugin pattern for creating plugins in RPGMaker MV
View PluginPattern.js
//=============================================================================
// PluginPattern.js
//=============================================================================
/*:
*
* @author Plugin Author Name
* @plugindesc The description of my plugin.
*