diff --git a/projects/asciilib2/examples/.gitignore b/projects/asciilib2/examples/.gitignore new file mode 100644 index 00000000..1fe2d303 --- /dev/null +++ b/projects/asciilib2/examples/.gitignore @@ -0,0 +1 @@ +export/ \ No newline at end of file diff --git a/projects/asciilib2/examples/death-trap/.vscode/extensions.json b/projects/asciilib2/examples/death-trap/.vscode/extensions.json new file mode 100644 index 00000000..419972a4 --- /dev/null +++ b/projects/asciilib2/examples/death-trap/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "openfl.lime-vscode-extension" + ] +} diff --git a/projects/asciilib2/examples/death-trap/.vscode/launch.json b/projects/asciilib2/examples/death-trap/.vscode/launch.json new file mode 100644 index 00000000..5e9a7a19 --- /dev/null +++ b/projects/asciilib2/examples/death-trap/.vscode/launch.json @@ -0,0 +1,21 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Build + Debug", + "type": "lime", + "request": "launch" + }, + { + "name": "Debug", + "type": "lime", + "request": "launch", + "preLaunchTask": null + }, + { + "name": "Macro", + "type": "haxe-eval", + "request": "launch" + } + ] +} diff --git a/projects/asciilib2/examples/death-trap/.vscode/settings.json b/projects/asciilib2/examples/death-trap/.vscode/settings.json new file mode 100644 index 00000000..4c1a0e92 --- /dev/null +++ b/projects/asciilib2/examples/death-trap/.vscode/settings.json @@ -0,0 +1,13 @@ +{ + "search.exclude": { + "export/**/*.hx": true + }, + "[haxe]": { + "editor.formatOnSave": true, + "editor.formatOnPaste": true, + "editor.codeActionsOnSave": { + "source.sortImports": true + } + }, + "haxe.enableExtendedIndentation": true +} \ No newline at end of file diff --git a/projects/asciilib2/examples/death-trap/.vscode/tasks.json b/projects/asciilib2/examples/death-trap/.vscode/tasks.json new file mode 100644 index 00000000..16a77646 --- /dev/null +++ b/projects/asciilib2/examples/death-trap/.vscode/tasks.json @@ -0,0 +1,13 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "type": "lime", + "command": "test", + "group": { + "kind": "build", + "isDefault": true + } + } + ] +} diff --git a/projects/asciilib2/examples/death-trap/Project.xml b/projects/asciilib2/examples/death-trap/Project.xml new file mode 100644 index 00000000..2844bbfb --- /dev/null +++ b/projects/asciilib2/examples/death-trap/Project.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/projects/asciilib2/examples/death-trap/assets/data/data-goes-here.txt b/projects/asciilib2/examples/death-trap/assets/data/data-goes-here.txt new file mode 100644 index 00000000..e69de29b diff --git a/projects/asciilib2/examples/death-trap/assets/images/images-go-here.txt b/projects/asciilib2/examples/death-trap/assets/images/images-go-here.txt new file mode 100644 index 00000000..e69de29b diff --git a/projects/asciilib2/examples/death-trap/assets/music/music-goes-here.txt b/projects/asciilib2/examples/death-trap/assets/music/music-goes-here.txt new file mode 100644 index 00000000..e69de29b diff --git a/projects/asciilib2/examples/death-trap/assets/sounds/sounds-go-here.txt b/projects/asciilib2/examples/death-trap/assets/sounds/sounds-go-here.txt new file mode 100644 index 00000000..e69de29b diff --git a/projects/asciilib2/examples/death-trap/hxformat.json b/projects/asciilib2/examples/death-trap/hxformat.json new file mode 100644 index 00000000..66cb3869 --- /dev/null +++ b/projects/asciilib2/examples/death-trap/hxformat.json @@ -0,0 +1,15 @@ +{ + "lineEnds": { + "leftCurly": "both", + "rightCurly": "both", + "objectLiteralCurly": { + "leftCurly": "after" + } + }, + "sameLine": { + "ifElse": "next", + "doWhile": "next", + "tryBody": "next", + "tryCatch": "next" + } +} diff --git a/projects/asciilib2/examples/death-trap/source/AssetPaths.hx b/projects/asciilib2/examples/death-trap/source/AssetPaths.hx new file mode 100644 index 00000000..db7ef444 --- /dev/null +++ b/projects/asciilib2/examples/death-trap/source/AssetPaths.hx @@ -0,0 +1,4 @@ +package; + +@:build(flixel.system.FlxAssets.buildFileReferences("assets", true)) +class AssetPaths {} diff --git a/projects/asciilib2/examples/death-trap/source/DeathTrapLogic.hx b/projects/asciilib2/examples/death-trap/source/DeathTrapLogic.hx new file mode 100644 index 00000000..e441e29f --- /dev/null +++ b/projects/asciilib2/examples/death-trap/source/DeathTrapLogic.hx @@ -0,0 +1,7 @@ +package; + +import asciilib.GameLogic; +import asciilib.Graphics; + +@:build(kiss.Kiss.build()) +class DeathTrapLogic implements GameLogic {} diff --git a/projects/asciilib2/examples/death-trap/source/DeathTrapLogic.kiss b/projects/asciilib2/examples/death-trap/source/DeathTrapLogic.kiss new file mode 100644 index 00000000..dd8caf1c --- /dev/null +++ b/projects/asciilib2/examples/death-trap/source/DeathTrapLogic.kiss @@ -0,0 +1,4 @@ +(defnew [] [:Int a 5]) + +(defmethod :Void update [:Float deltaSeconds] 0) +(defmethod :Void draw [:Graphics graphics] 0) \ No newline at end of file diff --git a/projects/asciilib2/examples/death-trap/source/Main.hx b/projects/asciilib2/examples/death-trap/source/Main.hx new file mode 100644 index 00000000..efa0e2d4 --- /dev/null +++ b/projects/asciilib2/examples/death-trap/source/Main.hx @@ -0,0 +1,13 @@ +package; + +import flixel.FlxGame; +import openfl.display.Sprite; + +class Main extends Sprite +{ + public function new() + { + super(); + addChild(new FlxGame(0, 0, PlayState)); + } +} diff --git a/projects/asciilib2/examples/death-trap/source/PlayState.hx b/projects/asciilib2/examples/death-trap/source/PlayState.hx new file mode 100644 index 00000000..32d15852 --- /dev/null +++ b/projects/asciilib2/examples/death-trap/source/PlayState.hx @@ -0,0 +1,23 @@ +package; + +import flixel.FlxState; +import asciilib.Game; +import asciilib.backends.flixel.*; + +class PlayState extends FlxState +{ + var game:Game; + + override public function create() + { + super.create(); + game = new Game("Beware Yon Death Trap", 100, 40, 8, 12, new DeathTrapLogic(), new FlxGraphicsBackend()); + } + + override public function update(elapsed:Float) + { + super.update(elapsed); + game.update(elapsed); + game.draw(); + } +} diff --git a/projects/asciilib2/haxelib.json b/projects/asciilib2/haxelib.json new file mode 100644 index 00000000..df37ad85 --- /dev/null +++ b/projects/asciilib2/haxelib.json @@ -0,0 +1,15 @@ +{ + "name": "asciilib", + "url": "https://github.com/hissvn/kisslang", + "license": "LGPL", + "tags": ["cross"], + "description": "", + "version": "0.0.0", + "releasenote": "It isn't safe to use this library yet.", + "contributors": ["NQNStudios"], + "classPath": "src/", + "main": "Main", + "dependencies": { + "kiss": "" + } +} \ No newline at end of file diff --git a/projects/asciilib2/src/asciilib/backends/flixel/FlxGraphicsBackend.hx b/projects/asciilib2/src/asciilib/backends/flixel/FlxGraphicsBackend.hx new file mode 100644 index 00000000..93749d83 --- /dev/null +++ b/projects/asciilib2/src/asciilib/backends/flixel/FlxGraphicsBackend.hx @@ -0,0 +1,7 @@ +package asciilib.backends.flixel; + +import asciilib.GraphicsBackend; +import asciilib.Graphics; + +@:build(kiss.Kiss.build()) +class FlxGraphicsBackend implements GraphicsBackend {} diff --git a/projects/asciilib2/src/asciilib/backends/flixel/FlxGraphicsBackend.kiss b/projects/asciilib2/src/asciilib/backends/flixel/FlxGraphicsBackend.kiss new file mode 100644 index 00000000..741625e8 --- /dev/null +++ b/projects/asciilib2/src/asciilib/backends/flixel/FlxGraphicsBackend.kiss @@ -0,0 +1,3 @@ +(defnew [] [:Int a 5]) +(defmethod :Void initialize [:String title :Int width :Int height :Int letterWidth :Int letterHeight] 0) +(defmethod :Void draw [:Graphics graphics] 0) \ No newline at end of file