This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package macros; | |
#if macro | |
import haxe.DynamicAccess; | |
import Types.DepotFile; | |
import sys.io.File; | |
import sys.FileSystem; | |
import haxe.macro.Expr.Field; | |
import haxe.Json; | |
import haxe.macro.Context; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package buildMacros; | |
import Structs.ZoomT; | |
import sys.FileSystem; | |
#if macro | |
import Structs.ChangeColorT; | |
import Structs.ChangeBrushT; | |
import haxe.macro.ExprTools; | |
import haxe.macro.Expr.Field; | |
import haxe.macro.Context; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//============================================================================= | |
// RMMVNodeP1.js | |
//============================================================================= | |
/*: | |
* @author PluginDev | |
* @plugindesc A plugin to read and write files using Node.js | |
* | |
*/ | |
(function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* From The Flixel Documentation | |
* The dimensions of the game world, used by the quad tree for collisions and overlap checks. | |
* Use .set() instead of creating a new object! | |
* ------ | |
* By updating the value of this element, we can fix our collision detection once again. | |
* Best to call this in your update function. | |
*/ | |
FlxG.worldBounds.set(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import flixel.FlxCamera; | |
import flixel.FlxObject; | |
//Sets the screen position of a FlxObject using setPosition(which is in world coordinates) | |
function setScreenPosition(obj:FlxObject, point:FlxPoint, ?camera:FlxCamera) { | |
if (camera == null) { | |
camera = FlxG.camera; | |
} | |
if (obj.pixelPerfectPosition) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Call this function to figure out the on-screen position of the object. | |
* | |
* @param Point Takes a `FlxPoint` object and assigns the post-scrolled X and Y values of this object to it. | |
* @param Camera Specify which game camera you want. | |
* If `null`, it will just grab the first global camera. | |
* @return The Point you passed in, or a new Point if you didn't pass one, | |
* containing the screen X and Y position of this object. | |
*/ | |
public function getScreenPosition(?point:FlxPoint, ?Camera:FlxCamera):FlxPoint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import flixel.FlxState; | |
import flixel.group.FlxGroup; | |
import flixel.FlxSprite; | |
import flixel.util.FlxColor; | |
class PlayState extends FlxState { | |
//bullet group for holding player bullets | |
public var playerBulletGrp:FlxTypedGroup<FlxSprite>; | |
public static inline var PLAYER_BULLET_CAP:Int = 20; | |
override public function create() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Direction { | |
Left; | |
Right; | |
Up; | |
Down; | |
} | |
function main() { | |
currentDirection(Left); | |
currentDirection(Right); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import haxe.Rest; | |
function main() { | |
var result = pipe('A', | |
(val:String) -> val.toUpperCase(), | |
(val2:String) -> val2 += " " + "World"); | |
trace(result); //A World | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import haxe.Rest; | |
function main() { | |
trace(sum(1, 2, 3)); | |
trace(sum('Hello', ' World')); | |
} | |
function sum(...rest:Dynamic) { | |
var result = null; | |
for(element in rest) { |