Refactor travis testing

This commit is contained in:
2021-06-07 12:36:22 -06:00
parent 32698b2d5b
commit 610a977b7c
77 changed files with 76 additions and 116 deletions

View File

@@ -0,0 +1 @@
export/

View File

@@ -0,0 +1,5 @@
{
"recommendations": [
"openfl.lime-vscode-extension"
]
}

View File

@@ -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"
}
]
}

View File

@@ -0,0 +1,13 @@
{
"search.exclude": {
"export/**/*.hx": true
},
"[haxe]": {
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.codeActionsOnSave": {
"source.sortImports": true
}
},
"haxe.enableExtendedIndentation": true
}

View File

@@ -0,0 +1,13 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "lime",
"command": "test",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}

View File

@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<!-- _________________________ Application Settings _________________________ -->
<app title="TurnBasedRPG" file="TurnBasedRPG" main="Main" version="0.0.1" company="HaxeFlixel" />
<!--The flixel preloader is not accurate in Chrome. You can use it regularly if you embed the swf into a html file
or you can set the actual size of your file manually at "FlxPreloaderBase-onUpdate-bytesTotal"-->
<app preloader="flixel.system.FlxPreloader" />
<!--Minimum without FLX_NO_GAMEPAD: 11.8, without FLX_NO_NATIVE_CURSOR: 11.2-->
<set name="SWF_VERSION" value="11.8" />
<!-- ____________________________ Window Settings ___________________________ -->
<!--These window settings apply to all targets-->
<window width="640" height="480" fps="60" background="#000000" hardware="true" vsync="false" />
<!--HTML5-specific-->
<window if="html5" resizable="false" />
<!--Desktop-specific-->
<window if="desktop" orientation="landscape" fullscreen="false" resizable="true" />
<!--Mobile-specific-->
<window if="mobile" orientation="landscape" fullscreen="true" width="0" height="0" />
<!-- _____________________________ Path Settings ____________________________ -->
<set name="BUILD_DIR" value="export" />
<classpath name="source" />
<assets path="assets" />
<!-- _______________________________ Libraries ______________________________ -->
<haxelib name="flixel" />
<haxelib name="kiss" />
<!--In case you want to use the addons package-->
<haxelib name="flixel-addons" />
<!--In case you want to use the ui package-->
<!--<haxelib name="flixel-ui" />-->
<!--In case you want to use nape with flixel-->
<!--<haxelib name="nape-haxe4" />-->
<!-- ______________________________ Haxedefines _____________________________ -->
<!--Enable the Flixel core recording system-->
<!--<haxedef name="FLX_RECORD" />-->
<!--Disable the right and middle mouse buttons-->
<!--<haxedef name="FLX_NO_MOUSE_ADVANCED" />-->
<!--Disable the native cursor API on Flash-->
<!--<haxedef name="FLX_NO_NATIVE_CURSOR" />-->
<!--Optimise inputs, be careful you will get null errors if you don't use conditionals in your game-->
<haxedef name="FLX_NO_MOUSE" if="mobile" />
<haxedef name="FLX_NO_KEYBOARD" if="mobile" />
<haxedef name="FLX_NO_TOUCH" if="desktop" />
<!--<haxedef name="FLX_NO_GAMEPAD" />-->
<!--Disable the Flixel core sound tray-->
<!--<haxedef name="FLX_NO_SOUND_TRAY" />-->
<!--Disable the Flixel sound management code-->
<!--<haxedef name="FLX_NO_SOUND_SYSTEM" />-->
<!--Disable the Flixel core focus lost screen-->
<!--<haxedef name="FLX_NO_FOCUS_LOST_SCREEN" />-->
<!--Disable the Flixel core debugger. Automatically gets set whenever you compile in release mode!-->
<haxedef name="FLX_NO_DEBUG" unless="debug" />
<!--Enable this for Nape release builds for a serious peformance improvement-->
<haxedef name="NAPE_RELEASE_BUILD" unless="debug" />
<!-- _________________________________ Custom _______________________________ -->
<!--Place custom nodes like icons here (higher priority to override the HaxeFlixel icon)-->
</project>

View File

@@ -0,0 +1,3 @@
# rpg-tutorial
Port of the RPG made in this [official HaxeFlixel tutorial](https://haxeflixel.com/documentation/tutorial/)

View File

@@ -0,0 +1,57 @@
{
"ogmoVersion": "3.4.0",
"width": 640,
"height": 480,
"offsetX": 0,
"offsetY": 0,
"layers": [
{
"name": "entities",
"_eid": "65210876",
"offsetX": 0,
"offsetY": 0,
"gridCellWidth": 16,
"gridCellHeight": 16,
"gridCellsX": 40,
"gridCellsY": 30,
"entities": [
{"name": "player", "id": 0, "_eid": "65218053", "x": 432, "y": 288, "originX": 0, "originY": 0},
{"name": "coin", "id": 1, "_eid": "72607845", "x": 384, "y": 288, "originX": 0, "originY": 0},
{"name": "coin", "id": 2, "_eid": "72607845", "x": 336, "y": 288, "originX": 0, "originY": 0},
{"name": "coin", "id": 3, "_eid": "72607845", "x": 352, "y": 256, "originX": 0, "originY": 0},
{"name": "coin", "id": 4, "_eid": "72607845", "x": 400, "y": 240, "originX": 0, "originY": 0},
{"name": "coin", "id": 5, "_eid": "72607845", "x": 368, "y": 208, "originX": 0, "originY": 0},
{"name": "coin", "id": 6, "_eid": "72607845", "x": 304, "y": 208, "originX": 0, "originY": 0},
{"name": "coin", "id": 7, "_eid": "72607845", "x": 256, "y": 176, "originX": 0, "originY": 0},
{"name": "coin", "id": 8, "_eid": "72607845", "x": 272, "y": 224, "originX": 0, "originY": 0},
{"name": "coin", "id": 9, "_eid": "72607845", "x": 368, "y": 160, "originX": 0, "originY": 0},
{"name": "coin", "id": 10, "_eid": "72607845", "x": 336, "y": 112, "originX": 0, "originY": 0},
{"name": "coin", "id": 11, "_eid": "72607845", "x": 400, "y": 48, "originX": 0, "originY": 0},
{"name": "coin", "id": 12, "_eid": "72607845", "x": 320, "y": 48, "originX": 0, "originY": 0},
{"name": "coin", "id": 13, "_eid": "72607845", "x": 272, "y": 112, "originX": 0, "originY": 0},
{"name": "coin", "id": 14, "_eid": "72607845", "x": 208, "y": 96, "originX": 0, "originY": 0},
{"name": "coin", "id": 15, "_eid": "72607845", "x": 176, "y": 128, "originX": 0, "originY": 0},
{"name": "coin", "id": 16, "_eid": "72607845", "x": 352, "y": 80, "originX": 0, "originY": 0},
{"name": "enemy", "id": 17, "_eid": "23281894", "x": 384, "y": 256, "originX": 0, "originY": 0},
{"name": "enemy", "id": 18, "_eid": "23281894", "x": 272, "y": 192, "originX": 0, "originY": 0},
{"name": "enemy", "id": 19, "_eid": "23281894", "x": 352, "y": 112, "originX": 0, "originY": 0},
{"name": "boss", "id": 20, "_eid": "23280424", "x": 192, "y": 112, "originX": 0, "originY": 0},
{"name": "enemy", "id": 21, "_eid": "23281894", "x": 384, "y": 32, "originX": 0, "originY": 0}
]
},
{
"name": "walls",
"_eid": "65212980",
"offsetX": 0,
"offsetY": 0,
"gridCellWidth": 16,
"gridCellHeight": 16,
"gridCellsX": 40,
"gridCellsY": 30,
"tileset": "tiles",
"data": [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
"exportMode": 0,
"arrayMode": 0
}
]
}

View File

@@ -0,0 +1,187 @@
{
"name": "HaxeFlixel Tutorial",
"ogmoVersion": "3.4.0",
"levelPaths": ["."],
"backgroundColor": "#282c34ff",
"gridColor": "#3c4049cc",
"anglesRadians": false,
"directoryDepth": 5,
"layerGridDefaultSize": {"x": 16, "y": 16},
"levelDefaultSize": {"x": 320, "y": 240},
"levelMinSize": {"x": 640, "y": 480},
"levelMaxSize": {"x": 640, "y": 480},
"levelValues": [],
"defaultExportMode": ".json",
"compactExport": false,
"externalScript": "",
"playCommand": "",
"entityTags": [],
"layers": [
{
"definition": "entity",
"name": "entities",
"gridSize": {"x": 16, "y": 16},
"exportID": "65210876",
"requiredTags": [],
"excludedTags": []
},
{
"definition": "tile",
"name": "walls",
"gridSize": {"x": 16, "y": 16},
"exportID": "65212980",
"exportMode": 0,
"arrayMode": 0,
"defaultTileset": ""
}
],
"entities": [
{
"exportID": "65218053",
"name": "player",
"limit": 1,
"size": {"x": 16, "y": 16},
"origin": {"x": 0, "y": 0},
"originAnchored": true,
"shape": {
"label": "Rectangle",
"points": [
{"x": -1, "y": -1},
{"x": 1, "y": -1},
{"x": -1, "y": 1},
{"x": 1, "y": -1},
{"x": -1, "y": 1},
{"x": 1, "y": 1}
]
},
"color": "#32ff00ff",
"tileX": false,
"tileY": false,
"tileSize": {"x": 16, "y": 16},
"resizeableX": false,
"resizeableY": false,
"rotatable": false,
"rotationDegrees": 360,
"canFlipX": false,
"canFlipY": false,
"canSetColor": false,
"hasNodes": false,
"nodeLimit": 0,
"nodeDisplay": 0,
"nodeGhost": true,
"tags": [],
"values": []
},
{
"exportID": "72607845",
"name": "coin",
"limit": -1,
"size": {"x": 16, "y": 16},
"origin": {"x": 0, "y": 0},
"originAnchored": true,
"shape": {
"label": "Rectangle",
"points": [
{"x": -1, "y": -1},
{"x": 1, "y": -1},
{"x": -1, "y": 1},
{"x": 1, "y": -1},
{"x": -1, "y": 1},
{"x": 1, "y": 1}
]
},
"color": "#ffe900ff",
"tileX": false,
"tileY": false,
"tileSize": {"x": 16, "y": 16},
"resizeableX": false,
"resizeableY": false,
"rotatable": false,
"rotationDegrees": 360,
"canFlipX": false,
"canFlipY": false,
"canSetColor": false,
"hasNodes": false,
"nodeLimit": 0,
"nodeDisplay": 0,
"nodeGhost": true,
"tags": [],
"values": []
},
{
"exportID": "23281894",
"name": "enemy",
"limit": -1,
"size": {"x": 16, "y": 16},
"origin": {"x": 0, "y": 0},
"originAnchored": true,
"shape": {
"label": "Rectangle",
"points": [
{"x": -1, "y": -1},
{"x": 1, "y": -1},
{"x": -1, "y": 1},
{"x": 1, "y": -1},
{"x": -1, "y": 1},
{"x": 1, "y": 1}
]
},
"color": "#ff6700ff",
"tileX": false,
"tileY": false,
"tileSize": {"x": 16, "y": 16},
"resizeableX": false,
"resizeableY": false,
"rotatable": false,
"rotationDegrees": 360,
"canFlipX": false,
"canFlipY": false,
"canSetColor": false,
"hasNodes": false,
"nodeLimit": 0,
"nodeDisplay": 0,
"nodeGhost": true,
"tags": [],
"values": []
},
{
"exportID": "23280424",
"name": "boss",
"limit": -1,
"size": {"x": 16, "y": 16},
"origin": {"x": 0, "y": 0},
"originAnchored": true,
"shape": {
"label": "Rectangle",
"points": [
{"x": -1, "y": -1},
{"x": 1, "y": -1},
{"x": -1, "y": 1},
{"x": 1, "y": -1},
{"x": -1, "y": 1},
{"x": 1, "y": 1}
]
},
"color": "#ff0000ff",
"tileX": false,
"tileY": false,
"tileSize": {"x": 16, "y": 16},
"resizeableX": false,
"resizeableY": false,
"rotatable": false,
"rotationDegrees": 360,
"canFlipX": false,
"canFlipY": false,
"canSetColor": false,
"hasNodes": false,
"nodeLimit": 0,
"nodeDisplay": 0,
"nodeGhost": true,
"tags": [],
"values": []
}
],
"tilesets": [
{"label": "tiles", "path": "../images/tiles.png", "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAQCAYAAABQrvyxAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODRBQjNDODZENDhCMTFFMzk5N0RDMzAxQTc5NEM5RkMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODRBQjNDODdENDhCMTFFMzk5N0RDMzAxQTc5NEM5RkMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4NEFCM0M4NEQ0OEIxMUUzOTk3REMzMDFBNzk0QzlGQyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4NEFCM0M4NUQ0OEIxMUUzOTk3REMzMDFBNzk0QzlGQyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PrOLMN8AAACUSURBVHja7JWhDoAgEEBPRrERbVYCX+If8Z8Eqo2IyYi7wOYYTncYuI3XD94bDKaUErSwWZtWY0izu3NAnc3zEhpBAVyIQvAeWuKPEEAAQ7I8IjjLswso5RHZq2iNUp7lFRoBI2AEQN+vEL5A+EM/MSvV7wm8ySNnjH0GfJGvRQhu8mWE/GPz2g/5hUVrkvw94hJgALO2Vr1s43dIAAAAAElFTkSuQmCC", "tileWidth": 16, "tileHeight": 16, "tileSeparationX": 0, "tileSeparationY": 0, "tileMarginX": 0, "tileMarginY": 0}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 984 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1,15 @@
{
"lineEnds": {
"leftCurly": "both",
"rightCurly": "both",
"objectLiteralCurly": {
"leftCurly": "after"
}
},
"sameLine": {
"ifElse": "next",
"doWhile": "next",
"tryBody": "next",
"tryCatch": "next"
}
}

View File

@@ -0,0 +1,4 @@
package;
@:build(flixel.system.FlxAssets.buildFileReferences("assets", true))
class AssetPaths {}

View File

@@ -0,0 +1,4 @@
package;
@:build(kiss.Kiss.build())
class Coin extends FlxSprite {}

View File

@@ -0,0 +1,18 @@
(defmethod new [:Float x :Float y]
(super x y)
(loadGraphic AssetPaths.coin__png false 8 8))
(defmethod &override :Void kill []
(set alive false)
(FlxTween.tween
this
(object
alpha 0
y (- y 16))
0.33
(object
ease FlxEase.circOut
onComplete finishKill)))
(defmethod finishKill [_]
(set exists false))

View File

@@ -0,0 +1,13 @@
package;
import flixel.FlxObject;
import flixel.FlxSprite;
enum EnemyType
{
REGULAR;
BOSS;
}
@:build(kiss.Kiss.build())
class Enemy extends FlxSprite {}

View File

@@ -0,0 +1,80 @@
(defvar &inline :Float SPEED 140)
(defnew [:Float x :Float y :EnemyType _type]
[:EnemyType type _type
:FSM brain (new FSM idle)
&mut :Float idleTimer 0
&mut :Float moveDirection -1
&mut :Bool seesPlayer false
&mut :FlxPoint playerPosition (FlxPoint.get)]
(super x y)
(loadGraphic
(case type
(BOSS
AssetPaths.boss__png)
(otherwise AssetPaths.enemy__png))
true
16
16)
(setFacingFlip FlxObject.LEFT false false)
(setFacingFlip FlxObject.RIGHT true false)
(animation.add "d" [0 1 0 2] 6 false)
(animation.add "lr" [3 4 3 5] 6 false)
(animation.add "u" [6 7 6 8] 6 false)
(set drag.x (set drag.y 10))
(set width 8)
(set height 14)
(set offset.x 4)
(set offset.y 2))
(defmethod &override :Void update [:Float elapsed]
(when (and
(or !(= velocity.x 0) !(= velocity.y 0))
(= touching FlxObject.NONE))
(if (> (Math.abs velocity.x) (Math.abs velocity.y))
(if (< velocity.x 0)
(set facing FlxObject.LEFT)
(set facing FlxObject.RIGHT))
(if (< velocity.y 0)
(set facing FlxObject.UP)
(set facing FlxObject.DOWN)))
(case facing
((or FlxObject.LEFT FlxObject.RIGHT)
(animation.play "lr"))
(FlxObject.UP
(animation.play "u"))
(FlxObject.DOWN
(animation.play "d"))))
(brain.update elapsed)
(super.update elapsed))
(defmethod :Void idle [:Float elapsed]
(cond
(seesPlayer
// TODO (the FSM) here should not be necessary!
(set .activeState (the FSM brain) chase))
((<= idleTimer 0)
(if (FlxG.random.bool 1)
{
(set moveDirection -1)
(set velocity.x (set velocity.y 0))
}
{
(set moveDirection (* 45 (FlxG.random.int 0 8)))
(velocity.set (* SPEED 0.5) 0)
(velocity.rotate (FlxPoint.weak) moveDirection)
})
(set idleTimer (FlxG.random.int 1 4)))
(true
(-= idleTimer elapsed))))
(defmethod :Void chase [:Float elapsed]
(if !seesPlayer
(set brain.activeState idle)
(FlxVelocity.moveTowardsPoint this playerPosition (Std.int SPEED))))

View File

@@ -0,0 +1,4 @@
package;
@:build(kiss.Kiss.build())
class FSM {}

View File

@@ -0,0 +1,7 @@
(defprop &mut :Float->Void activeState null)
(defmethod new [:Float->Void initialState]
(set activeState initialState))
(defmethod :Void update [:Float elapsed]
(activeState elapsed))

View File

@@ -0,0 +1,4 @@
package;
@:build(kiss.Kiss.build())
class Main extends Sprite {}

View File

@@ -0,0 +1,3 @@
(defmethod new []
(super)
(addChild (new FlxGame 320 240 MenuState)))

View File

@@ -0,0 +1,4 @@
package;
@:build(kiss.Kiss.build())
class MenuState extends FlxState {}

View File

@@ -0,0 +1,9 @@
(defprop &mut :FlxButton playButton null)
(defmethod &override :Void create []
(set playButton (new FlxButton 0 0 "Play" clickPlay))
(playButton.screenCenter)
(add playButton))
(defun clickPlay []
(FlxG.switchState (new PlayState)))

View File

@@ -0,0 +1,4 @@
package;
@:build(kiss.Kiss.build())
class PlayState extends FlxState {}

View File

@@ -0,0 +1,51 @@
(defprop &mut :Player player null)
(defprop &mut :FlxOgmo3Loader map null)
(defprop &mut :FlxTilemap walls null)
(defprop &mut :FlxTypedGroup<Coin> coins null)
(defprop &mut :FlxTypedGroup<Enemy> enemies null)
(defmethod &override :Void create []
(set map (new FlxOgmo3Loader AssetPaths.turnBasedRPG__ogmo AssetPaths.room_001__json))
(set walls (map.loadTilemap AssetPaths.tiles__png "walls"))
(walls.follow)
(walls.setTileProperties 1 FlxObject.NONE)
(walls.setTileProperties 2 FlxObject.ANY)
(add walls)
(set coins (new FlxTypedGroup<Coin>))
(add coins)
(set enemies (new FlxTypedGroup<Enemy>))
(add enemies)
(map.loadEntities placeEntities "entities")
(FlxG.camera.follow player TOPDOWN 1)
(super.create))
(defmethod :Void placeEntities [:EntityData entity]
(case entity.name
("player"
(set player (new Player entity.x entity.y))
(add player))
("coin"
(coins.add (new Coin (+ entity.x 4) (+ entity.y 4))))
("enemy"
(enemies.add (new Enemy (+ entity.x 4) entity.y REGULAR)))
("boss"
(enemies.add (new Enemy (+ entity.x 4) entity.y BOSS)))))
(defmethod &override :Void update [:Float elapsed]
(super.update elapsed)
(FlxG.collide player walls)
(FlxG.overlap player coins playerTouchCoin)
(FlxG.collide enemies walls)
(enemies.forEachAlive checkEnemyVision))
(defmethod :Void checkEnemyVision [:Enemy enemy]
(if (walls.ray (enemy.getMidpoint) (player.getMidpoint))
{
(set enemy.seesPlayer true)
(set enemy.playerPosition (player.getMidpoint))
}
(set enemy.seesPlayer false)))
(defmethod playerTouchCoin [:Player player :Coin coin]
(when (and player.alive player.exists coin.alive coin.exists)
(coin.kill)))

View File

@@ -0,0 +1,4 @@
package;
@:build(kiss.Kiss.build())
class Player extends FlxSprite {}

View File

@@ -0,0 +1,67 @@
(defvar &inline :Float SPEED 200)
(defmethod new [:Float x :Float y]
(super x y)
(loadGraphic AssetPaths.player__png true 16 16)
(setFacingFlip FlxObject.LEFT false false)
(setFacingFlip FlxObject.RIGHT true false)
(animation.add "lr" [3 4 3 5] 6 false)
(animation.add "u" [6 7 6 8] 6 false)
(animation.add "d" [0 1 0 2] 6 false)
(set drag.x (set drag.y 1600))
(setSize 8 8)
(offset.set 4 4))
(defmethod :Void updateMovement []
(let [[&mut up &mut down &mut left &mut right]
(map [[UP W] [DOWN S] [LEFT A] [RIGHT D]] FlxG.keys.anyPressed)]
(when (and up down)
(set up (set down false)))
(when (and left right)
(set left (set right false)))
(if (or up down left right)
(let [&mut :Float newAngle 0]
(cond
(up
(set newAngle -90)
(cond
(left
(set newAngle (- newAngle 45)))
(right
(set newAngle (+ newAngle 45))))
(set facing FlxObject.UP))
(down
(set newAngle 90)
(cond
(left
(set newAngle (+ newAngle 45)))
(right
(set newAngle (- newAngle 45))))
(set facing FlxObject.DOWN))
(left
(set newAngle 180)
(set facing FlxObject.LEFT))
(right
(set newAngle 0)
(set facing FlxObject.RIGHT)))
(velocity.set SPEED 0)
(velocity.rotate (FlxPoint.weak 0 0) newAngle))
(when animation.curAnim
(set animation.curAnim.curFrame 0)
(animation.curAnim.pause)))
// TODO != is not implemented. Not sure how it would work as a variadic, because other
// Lisps don't have that either
(when !(and (= 0 velocity.x) (= 0 velocity.y))
(case facing
((or FlxObject.LEFT FlxObject.RIGHT)
(animation.play "lr"))
(FlxObject.UP
(animation.play "u"))
(FlxObject.DOWN
(animation.play "d"))
(otherwise
(return))))))
(defmethod &override update [:Float elapsed]
(updateMovement)
(super.update elapsed))

View File

@@ -0,0 +1,17 @@
import flixel.FlxGame;
import openfl.display.Sprite;
import flixel.FlxState;
import flixel.ui.FlxButton;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.util.FlxColor;
import flixel.input.keyboard.FlxKey;
import flixel.math.FlxPoint;
import flixel.math.FlxVelocity;
import flixel.FlxObject;
import flixel.addons.editors.ogmo.FlxOgmo3Loader;
import flixel.tile.FlxTilemap;
import flixel.group.FlxGroup;
import flixel.tweens.FlxTween;
import flixel.tweens.FlxEase;
import kiss.Prelude;