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; | |
//Expose metatag is used to make sure that when the code is being referenced in the target language it'll be exposed | |
//for user's to override. I use this in JS to allow for modification, which is core to RPGMakerMV/MZ. | |
//Native metatag is used to make sure that when the code is compiled it uses the proper name. | |
//Native works both on classes and fields, which you can see for the x, y fields below. | |
@:expose("Point") | |
@:native("Point") | |
extern class Point extends pixi.core.math.Point { | |
/** |
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.util.FlxPath; | |
import flixel.FlxG; | |
import flixel.FlxSprite; | |
import flixel.util.FlxColor; | |
class Player extends FlxSprite { | |
public var walkPath:Array<FlxPoint>; | |
public function new(x:Float, y:Float) { | |
super(x, y); |
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; | |
// Path to your own depot file | |
@:build(macros.DepotMacros.buildDepotFile('assets/data/database.dpo')) | |
class DepotData {} |
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.FlxG; | |
import flixel.util.FlxColor; | |
class PlayState extends FlxState { | |
//Creating the player, enemies, and npc group. | |
public var npcs:FlxTypedGroup<FlxSprite>; | |
public var enemies:FlxTypedGroup<FlxSprite>; |
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.util.FlxColor; | |
import flixel.FlxSprite; | |
class Player extends FlxSprite { | |
// Whether the player is invicible or not | |
public var isInvincible:Bool; | |
//The amount of time to be invincible for in seconds | |
public static inline var INVINCIBLE_TIME:Float = 1.5; |
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 game.states; | |
import game.ui.TextButton; | |
/* | |
* Custom Pause Scene I made for my game. | |
*/ | |
class PauseSubState extends FlxSubState { | |
public var pauseText:FlxText; | |
private var pauseExitSound:FlxSound; |
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
/** | |
* Basic example of a scene used in the tutorial for HaxeFlixel as well. | |
*/ | |
class PlayState extends FlxState { | |
override public function create() { | |
super.create(); | |
add(new FlxText('Hello World', 32).screenCenter()); | |
} | |
override public function update(elapsed:Float) { | |
super.update(elapsed); |
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
//Module Level Main entry point in Haxe 4.2.0 | |
function main() { | |
trace('Hello 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
//Example of a main entry point in Haxe before 4.2 | |
class Main { | |
public static function main() { | |
trace('Hello 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
package game; | |
class State { | |
public var currentState:Float -> Void; | |
public function new(initialState:Float -> Void) { | |
currentState = initialState; | |
} |