A game engine, written on haxe that uses hscript as the base, the engine is called 'source' because whole game code is written in hscript file that is not part of the source code, so this engine allows you to code any game want without compiling source code.
1.Open the engine and accept the permission request, there would be an error, because you didn't create game files for now.
2.Go to your phone's storage, enable 'show hidden folders', there would be a folder called .Source-Engine
, inside that folder create a file called current.txt
and write in it your game's name, then, create a folder, with the same name, as you wrote in current.txt
, inside that folder, create file called main.hx
3.Open the engine, no errors would appear now, congratulations, you installed the engine
1.Inside folder with .exe file of the game, create current.txt
file and write in it your game's name, then, create a folder, with the same name, as you wrote in current.txt
, inside that folder, create file called main.hx
2.Open the engine, congratulations, you installed the engine
- hxvm-luajit and linc_luajit, you are able to make lua scripts from hscript file
- hxCodec, you are able to play videos in mp4 format
- spinehaxe (spine port to haxe), you are able to make spine sprites
- hscript, yoy can call another hscript (.hx) scripts from main.hx
- extension-androidtools, you are able to use some jni functions (available only in android version for obvious reasons)
- flixel, flixel-addons and flixel-ui, you can use flixel in it as you want
script
- current instance of the HScript class that runs this file
all of those are already in hscript and no need to import
import('package.class'); // you need to write package and class/enum name of the class/enum you want to import, typedef is unsupported.
- HClass class
available functions and variable for script you're connecting to that HClass:
var class:HClass = new HClass("path/to/hscript/file.hx", [arguements, for, functions]);
-
class
- current instance of the HClass object that launched this hscript file
function new(specify here all arguments, you wrote after path in new HClass) {}
- function that is runned when creating HClass object
function create(specify here all arguments, you wrote after path in new HClass) {}
- function that is runned instantly after call of the
new
function is completed
- HObject class
!important! this class is an extend of flixel.FlxSprite, so it's a child class of FlxSprite,
that means, that you can do same things as with FlxSprite with HObject.
(for example, set the frames for the sprite:
object.frames = FlxAtlasFrames....
)
available functions and variable for script you're connecting to that HObject:
var object:HObject = new HObject(x, y, "path/to/hscript/file.hx");
-
object
- current instance of the HObject object that launched this hscript file
function new(x, y) {}
- function that is runned when creating HClass object
function create(x, y) {}
- function that is runned instantly after call of the
new
function is completed
function update(elapsed) {}
- function that is runned each frame
function updatePost(elapsed) {}
- same as
update
function, but this one runs afterupdate
andsuper
call in the source code
setOffset(animName, x, y)
- function that sets the offset for animation of the object into an array
updateOffset()
- function that applying offsets that are set for current animation, if no offsets set to animation, offset is set to x - 0, y - 0
function destroy() {}
- function that is runned when object is going to be destroyed
other functions that don't need explanation:
function draw() {}
- should
return true;
to callsuper
andreturn false;
to not callsuper
function getGraphicMidpoint(?point:FlxPoint) {}
function getRotatedBounds(?newRect:FlxRect) {}
function getScreenBounds(?newRect:FlxRect, ?camera:FlxCamera) {}
function pixelsOverlapPoint(point:FlxPoint, Mask:Int = 0xFF, ?Camera:FlxCamera) {}
function loadGraphic(graphic:FlxGraphicAsset, animated:Bool = false, width:Int = 0, height:Int = 0, unique:Bool = false, ?Key:String) {}
- should
return true;
to callsuper
andreturn false;
to not callsuper
function getScreenBounds(?newRect:FlxRect, ?camera:FlxCamera) {}
- HScript class
available functions and variable for script you're connecting to that HClass:
var script:HScript = new HScript("path/to/hscript/file.hx");
function run() {}
- function that runs and parses the script, you can't set variables to script after calling this
function setVariable(name:String, val:Dynamic) {}
- function that sets
val
class/variable asname
to script
function getVariable(name:String) {}
- function that returns a variable from script, specified by
name
function executeFunc(funcName:String, ?args:Array<Any>) {}
- function that executes a function from script slecified by
funcName
withargs
arguments
- HState class !important! this class is an extend of flixel.FlxState, so it's a child class of FlxState, that means, that you can do same things as with FlxState with HState.
available functions and variable for script you're connecting to that HClass:
var state:HState = new HState("path/to/hscript/file.hx", [arguements, for, functions]);
-
state
- current instance of the HState object that launched this hscript file
function insert(i:Int, obj:FlxBasic) {}
- function that adds an object
obj
to layeri
function destroy() {}
- function that is runned when object is going to be destroyed
function new(specify here all arguments, you wrote after path in new HState) {}
- function that is runned when creating HState object
function create() {}
- function that is runned instantly after call of the
new
function is completed
function update(elapsed) {}
- function that is runned each frame
function updatePost(elapsed) {}
- same as
update
function, but this one runs afterupdate
andsuper
call in the source code
other functions that don't need explanation:
function add(obj:FlxBasic) {}
function remove(obj:FlxBasic) {}
function onFocus() {}
function onFocusLost() {}
function onResize(width:Int, height:Int) {}
function draw() {}
- HSubState class
literally same as HState, but this one is child class of flixel.FlxSubState, new things:
substate
- current instance of the HSubState object that launched this hscript file
P.S. state
is unavailable in HSubState
function close() {}
- function that is runned when substate is closing