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
class Main { | |
public static function main() { | |
trace(R.list); | |
trace(R.obj.foo); | |
} | |
} |
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
class Perlin { | |
public var repeat :Int; | |
public function new(repeat :Int = -1) { | |
this.repeat = repeat; | |
} | |
public function OctavePerlin(x :Float, y :Float, z :Float, octaves :Int, persistence :Float) { | |
var total :Float = 0; | |
var frequency :Float = 1; |
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
class Heightmap { | |
var size :Int; | |
var tiles :Array<Array<Null<Float>>>; | |
var d :Int; | |
public function new() { | |
} | |
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 luxe.Component; | |
import luxe.Input; | |
import luxe.Parcel; | |
import luxe.ParcelProgress; | |
import luxe.Rectangle; | |
import luxe.Sprite; | |
import luxe.Color; | |
import luxe.tween.easing.*; | |
import luxe.Text; |
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 Token { | |
TSymbol(s :String); | |
TTerminal(s :String); | |
TArrow; | |
TPlus; | |
TBracketOpen; | |
TBracketClose; | |
TNumber(v :Float); | |
TEof; |
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.macro.Expr; | |
import haxe.macro.Context; | |
class GenNew { | |
macro public static function build () : Array<Field> { | |
var fields = Context.getBuildFields(); | |
var args = []; | |
var assigns = []; | |
for (field in fields) { |
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
// Inspired by | |
// http://www.jorisdormans.nl/pdf/dormans2010_AdventuresInLevelDesign.pdf | |
// http://larc.unt.edu/ian/pubs/pcg2011.pdf | |
// http://larc.unt.edu/ian/pubs/DoranParberryQuests2015.pdf | |
// Idea: Use a macro to extract Symbol and Terminal information and populate enums | |
enum Symbol { | |
Quest; | |
SubQuest; |
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
// Inspired by http://www.jorisdormans.nl/pdf/dormans2010_AdventuresInLevelDesign.pdf | |
enum Symbol { | |
Dungeon; | |
Obstacle; | |
} | |
enum Terminal { | |
Treasure; | |
Key; |
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
class Script { | |
var program :hscript.Expr; | |
var interp :hscript.Interp; | |
public function new(source :haxe.io.Input) { | |
var parser = new hscript.Parser(); | |
interp = new hscript.Interp(); | |
try { | |
program = parser.parse(source); |
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
// "Fractal Cartoon" - former "DE edge detection" by Kali | |
// Cartoon-like effect using eiffies's edge detection found here: | |
// https://www.shadertoy.com/view/4ss3WB | |
// I used my own method previously but was too complicated and not compiling everywhere. | |
// Thanks to the suggestion by WouterVanNifterick. | |
// There are no lights and no AO, only color by normals and dark edges. | |