Commit 4887f606 by Иван Кубота

initial

parents
node_modules/*
package-lock.json
\ No newline at end of file
{
"__header__": {
"fileType": "LDtk Project JSON",
"app": "LDtk",
"doc": "https://ldtk.io/json",
"schema": "https://ldtk.io/files/JSON_SCHEMA.json",
"appAuthor": "Sebastien 'deepnight' Benard",
"appVersion": "0.9.3",
"url": "https://ldtk.io"
},
"jsonVersion": "0.9.3",
"nextUid": 178,
"worldLayout": "Free",
"worldGridWidth": 128,
"worldGridHeight": 128,
"defaultPivotX": 0,
"defaultPivotY": 0,
"defaultGridSize": 8,
"defaultLevelWidth": 256,
"defaultLevelHeight": 256,
"bgColor": "#4A5066",
"defaultLevelBgColor": "#1E2027",
"minifyJson": false,
"externalLevels": false,
"exportTiled": false,
"imageExportMode": "None",
"pngFilePattern": null,
"backupOnSave": false,
"backupLimit": 10,
"levelNamePattern": "Level_%idx",
"flags": ["DiscardPreCsvIntGrid"],
"defs": { "layers": [
{
"__type": "IntGrid",
"identifier": "Dialog",
"type": "IntGrid",
"uid": 159,
"gridSize": 8,
"displayOpacity": 1,
"pxOffsetX": 0,
"pxOffsetY": 0,
"requiredTags": [],
"excludedTags": [],
"intGridValues": [{ "value": 1, "identifier": null, "color": "#000000" }],
"autoTilesetDefUid": 9,
"autoRuleGroups": [
{ "uid": 169, "name": "New group", "active": true, "collapsed": false, "isOptional": false, "rules": [
{
"uid": 170,
"active": true,
"size": 3,
"tileIds": [216,217,218,219],
"chance": 1,
"breakOnMatch": true,
"pattern": [0,-1,0,-1,1,-1,0,-1,0],
"flipX": false,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 3075970,
"perlinScale": 0.2,
"perlinOctaves": 2
}
] },
{ "uid": 160, "name": "Dialog", "active": true, "collapsed": false, "isOptional": false, "rules": [
{
"uid": 173,
"active": false,
"size": 3,
"tileIds": [68],
"chance": 1,
"breakOnMatch": true,
"pattern": [0,0,1,0,-1,1,0,0,1],
"flipX": false,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 1626789,
"perlinScale": 0.2,
"perlinOctaves": 2
},
{
"uid": 167,
"active": true,
"size": 3,
"tileIds": [116],
"chance": 1,
"breakOnMatch": true,
"pattern": [0,1,0,-1,1,0,0,1,0],
"flipX": true,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 6714046,
"perlinScale": 0.2,
"perlinOctaves": 2
},
{
"uid": 166,
"active": true,
"size": 3,
"tileIds": [129],
"chance": 1,
"breakOnMatch": true,
"pattern": [0,0,0,1,1,1,0,-1,0],
"flipX": false,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 5411637,
"perlinScale": 0.2,
"perlinOctaves": 2
},
{
"uid": 164,
"active": true,
"size": 3,
"tileIds": [128],
"chance": 1,
"breakOnMatch": true,
"pattern": [0,1,0,-1,1,1,0,-1,0],
"flipX": true,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 6077188,
"perlinScale": 0.2,
"perlinOctaves": 2
},
{
"uid": 162,
"active": true,
"size": 3,
"tileIds": [105],
"chance": 1,
"breakOnMatch": true,
"pattern": [0,-1,0,1,1,1,0,0,0],
"flipX": false,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 9310792,
"perlinScale": 0.2,
"perlinOctaves": 2
},
{
"uid": 161,
"active": true,
"size": 3,
"tileIds": [104],
"chance": 1,
"breakOnMatch": true,
"pattern": [0,-1,0,-1,1,1,0,1,0],
"flipX": true,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 9119349,
"perlinScale": 0.2,
"perlinOctaves": 2
},
{
"uid": 163,
"active": true,
"size": 1,
"tileIds": [117],
"chance": 1,
"breakOnMatch": true,
"pattern": [1],
"flipX": false,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 9901491,
"perlinScale": 0.2,
"perlinOctaves": 2
}
] }
],
"autoSourceLayerDefUid": null,
"tilesetDefUid": null,
"tilePivotX": 0,
"tilePivotY": 0
},
{
"__type": "Tiles",
"identifier": "Trees",
"type": "Tiles",
"uid": 155,
"gridSize": 8,
"displayOpacity": 1,
"pxOffsetX": 0,
"pxOffsetY": 0,
"requiredTags": [],
"excludedTags": [],
"intGridValues": [{ "value": 1, "identifier": null, "color": "#000000" }],
"autoTilesetDefUid": null,
"autoRuleGroups": [],
"autoSourceLayerDefUid": null,
"tilesetDefUid": 151,
"tilePivotX": 0,
"tilePivotY": 0
},
{
"__type": "Entities",
"identifier": "Entities",
"type": "Entities",
"uid": 109,
"gridSize": 8,
"displayOpacity": 1,
"pxOffsetX": 0,
"pxOffsetY": 0,
"requiredTags": [],
"excludedTags": [],
"intGridValues": [{ "value": 1, "identifier": null, "color": "#000000" }],
"autoTilesetDefUid": null,
"autoRuleGroups": [],
"autoSourceLayerDefUid": null,
"tilesetDefUid": null,
"tilePivotX": 0,
"tilePivotY": 0
},
{
"__type": "IntGrid",
"identifier": "Patches",
"type": "IntGrid",
"uid": 110,
"gridSize": 8,
"displayOpacity": 1,
"pxOffsetX": 0,
"pxOffsetY": 0,
"requiredTags": [],
"excludedTags": [],
"intGridValues": [{ "value": 1, "identifier": "walls", "color": "#FFFFFF" }],
"autoTilesetDefUid": 9,
"autoRuleGroups": [
{ "uid": 111, "name": "Plants", "active": true, "collapsed": false, "isOptional": false, "rules": [
{
"uid": 112,
"active": true,
"size": 3,
"tileIds": [126,127,147,148],
"chance": 0.65,
"breakOnMatch": false,
"pattern": [0,1,0,0,-1,0,0,0,0],
"flipX": false,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 2671222,
"perlinScale": 0.2,
"perlinOctaves": 2
}
] },
{ "uid": 113, "name": "Dirt", "active": true, "collapsed": false, "isOptional": false, "rules": [
{
"uid": 114,
"active": true,
"size": 3,
"tileIds": [64],
"chance": 0.3,
"breakOnMatch": false,
"pattern": [0,0,0,0,-1,0,0,1,0],
"flipX": false,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 336628,
"perlinScale": 0.28,
"perlinOctaves": 2
},
{
"uid": 115,
"active": true,
"size": 3,
"tileIds": [92],
"chance": 1,
"breakOnMatch": true,
"pattern": [0,-1,0,0,1,0,0,-1,0],
"flipX": false,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 7378060,
"perlinScale": 0.2,
"perlinOctaves": 2
},
{
"uid": 116,
"active": true,
"size": 3,
"tileIds": [51],
"chance": 1,
"breakOnMatch": true,
"pattern": [0,-1,0,-1,1,0,0,0,0],
"flipX": true,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 8451851,
"perlinScale": 0.2,
"perlinOctaves": 2
},
{
"uid": 117,
"active": true,
"size": 3,
"tileIds": [75],
"chance": 1,
"breakOnMatch": true,
"pattern": [0,0,0,-1,1,0,0,-1,0],
"flipX": true,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 182798,
"perlinScale": 0.2,
"perlinOctaves": 2
},
{
"uid": 118,
"active": true,
"size": 3,
"tileIds": [52],
"chance": 1,
"breakOnMatch": true,
"pattern": [0,-1,0,0,1,0,0,0,0],
"flipX": false,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 5373312,
"perlinScale": 0.2,
"perlinOctaves": 2
},
{
"uid": 119,
"active": true,
"size": 3,
"tileIds": [76],
"chance": 1,
"breakOnMatch": true,
"pattern": [0,0,0,0,1,0,0,-1,0],
"flipX": false,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 9668495,
"perlinScale": 0.2,
"perlinOctaves": 2
},
{
"uid": 120,
"active": true,
"size": 3,
"tileIds": [63],
"chance": 1,
"breakOnMatch": true,
"pattern": [0,0,0,-1,1,0,0,0,0],
"flipX": true,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 4414423,
"perlinScale": 0.3,
"perlinOctaves": 2
},
{
"uid": 121,
"active": true,
"size": 1,
"tileIds": [1,2,3,4,5,6],
"chance": 1,
"breakOnMatch": true,
"pattern": [1],
"flipX": false,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 3417420,
"perlinScale": 0.2,
"perlinOctaves": 2
}
] }
],
"autoSourceLayerDefUid": null,
"tilesetDefUid": null,
"tilePivotX": 0,
"tilePivotY": 0
},
{
"__type": "IntGrid",
"identifier": "Level",
"type": "IntGrid",
"uid": 72,
"gridSize": 8,
"displayOpacity": 1,
"pxOffsetX": 0,
"pxOffsetY": 0,
"requiredTags": [],
"excludedTags": [],
"intGridValues": [ { "value": 1, "identifier": "walls", "color": "#FFFFFF" }, { "value": 2, "identifier": "water", "color": "#001CFF" } ],
"autoTilesetDefUid": 9,
"autoRuleGroups": [
{ "uid": 174, "name": "water", "active": true, "collapsed": false, "isOptional": false, "rules": [
{
"uid": 176,
"active": true,
"size": 3,
"tileIds": [134],
"chance": 1,
"breakOnMatch": true,
"pattern": [0,0,0,0,2,1,0,0,0],
"flipX": true,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 876060,
"perlinScale": 0.2,
"perlinOctaves": 2
},
{
"uid": 175,
"active": true,
"size": 1,
"tileIds": [123],
"chance": 1,
"breakOnMatch": true,
"pattern": [2],
"flipX": false,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 8355331,
"perlinScale": 0.2,
"perlinOctaves": 2
}
] },
{ "uid": 104, "name": "Plants", "active": true, "collapsed": false, "isOptional": false, "rules": [
{
"uid": 99,
"active": true,
"size": 3,
"tileIds": [126,127,147,148],
"chance": 0.65,
"breakOnMatch": false,
"pattern": [0,1,0,0,-1,0,0,0,0],
"flipX": false,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 2671222,
"perlinScale": 0.2,
"perlinOctaves": 2
}
] },
{ "uid": 85, "name": "Dirt", "active": true, "collapsed": false, "isOptional": false, "rules": [
{
"uid": 95,
"active": true,
"size": 3,
"tileIds": [64],
"chance": 0.3,
"breakOnMatch": false,
"pattern": [0,0,0,0,-1,0,0,1,0],
"flipX": false,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 336628,
"perlinScale": 0.28,
"perlinOctaves": 2
},
{
"uid": 98,
"active": true,
"size": 3,
"tileIds": [92],
"chance": 1,
"breakOnMatch": true,
"pattern": [0,-1,0,0,1,0,0,-1,0],
"flipX": false,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 7378060,
"perlinScale": 0.2,
"perlinOctaves": 2
},
{
"uid": 82,
"active": true,
"size": 3,
"tileIds": [51],
"chance": 1,
"breakOnMatch": true,
"pattern": [0,-1,0,-1,1,0,0,0,0],
"flipX": true,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 8451851,
"perlinScale": 0.2,
"perlinOctaves": 2
},
{
"uid": 83,
"active": true,
"size": 3,
"tileIds": [75],
"chance": 1,
"breakOnMatch": true,
"pattern": [0,0,0,-1,1,0,0,-1,0],
"flipX": true,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 182798,
"perlinScale": 0.2,
"perlinOctaves": 2
},
{
"uid": 76,
"active": true,
"size": 3,
"tileIds": [52],
"chance": 1,
"breakOnMatch": true,
"pattern": [0,-1,0,0,1,0,0,0,0],
"flipX": false,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 5373312,
"perlinScale": 0.2,
"perlinOctaves": 2
},
{
"uid": 84,
"active": true,
"size": 3,
"tileIds": [76],
"chance": 1,
"breakOnMatch": true,
"pattern": [0,0,0,0,1,0,0,-1,0],
"flipX": false,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 9668495,
"perlinScale": 0.2,
"perlinOctaves": 2
},
{
"uid": 81,
"active": true,
"size": 3,
"tileIds": [63],
"chance": 1,
"breakOnMatch": true,
"pattern": [0,0,0,-1,1,0,0,0,0],
"flipX": true,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 4414423,
"perlinScale": 0.3,
"perlinOctaves": 2
},
{
"uid": 73,
"active": true,
"size": 1,
"tileIds": [1,2,3,4,5,6],
"chance": 1,
"breakOnMatch": true,
"pattern": [1],
"flipX": false,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 3417420,
"perlinScale": 0.2,
"perlinOctaves": 2
}
] }
],
"autoSourceLayerDefUid": null,
"tilesetDefUid": null,
"tilePivotX": 0,
"tilePivotY": 0
},
{
"__type": "IntGrid",
"identifier": "Background",
"type": "IntGrid",
"uid": 133,
"gridSize": 8,
"displayOpacity": 1,
"pxOffsetX": 0,
"pxOffsetY": 0,
"requiredTags": [],
"excludedTags": [],
"intGridValues": [{ "value": 1, "identifier": null, "color": "#000000" }],
"autoTilesetDefUid": 9,
"autoRuleGroups": [{ "uid": 135, "name": "Stars", "active": true, "collapsed": false, "isOptional": false, "rules": [
{
"uid": 140,
"active": true,
"size": 3,
"tileIds": [4],
"chance": 1,
"breakOnMatch": true,
"pattern": [0,0,0,1,1,-1,0,0,0],
"flipX": false,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 914808,
"perlinScale": 0.2,
"perlinOctaves": 2
},
{
"uid": 139,
"active": true,
"size": 3,
"tileIds": [4],
"chance": 1,
"breakOnMatch": true,
"pattern": [0,0,0,-1,1,1,0,0,0],
"flipX": false,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 830495,
"perlinScale": 0.2,
"perlinOctaves": 2
},
{
"uid": 138,
"active": true,
"size": 3,
"tileIds": [3],
"chance": 1,
"breakOnMatch": true,
"pattern": [0,0,0,1,1,1,0,0,0],
"flipX": false,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 9185558,
"perlinScale": 0.2,
"perlinOctaves": 2
},
{
"uid": 137,
"active": true,
"size": 3,
"tileIds": [6],
"chance": 1,
"breakOnMatch": true,
"pattern": [0,1,0,0,1,0,0,0,0],
"flipX": false,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 4507508,
"perlinScale": 0.2,
"perlinOctaves": 2
},
{
"uid": 136,
"active": true,
"size": 1,
"tileIds": [1],
"chance": 1,
"breakOnMatch": true,
"pattern": [1],
"flipX": false,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": null,
"perlinActive": false,
"perlinSeed": 9130205,
"perlinScale": 0.2,
"perlinOctaves": 2
}
] }],
"autoSourceLayerDefUid": null,
"tilesetDefUid": null,
"tilePivotX": 0,
"tilePivotY": 0
}
], "entities": [
{
"identifier": "Key",
"uid": 108,
"tags": ["key"],
"width": 8,
"height": 8,
"resizableX": false,
"resizableY": false,
"keepAspectRatio": false,
"fillOpacity": 1,
"lineOpacity": 1,
"hollow": false,
"color": "#94D9B3",
"renderMode": "Tile",
"showName": true,
"tilesetId": 9,
"tileId": 41,
"tileRenderMode": "FitInside",
"maxCount": 0,
"limitScope": "PerLevel",
"limitBehavior": "MoveLastOne",
"pivotX": 0,
"pivotY": 0,
"fieldDefs": [
{
"identifier": "action1",
"__type": "Point",
"uid": 122,
"type": "F_Point",
"isArray": false,
"canBeNull": true,
"arrayMinLength": null,
"arrayMaxLength": null,
"editorDisplayMode": "PointStar",
"editorDisplayPos": "Above",
"editorAlwaysShow": true,
"editorCutLongValues": true,
"min": null,
"max": null,
"regex": null,
"acceptFileTypes": null,
"defaultOverride": null,
"textLanguageMode": null
},
{
"identifier": "onInterract",
"__type": "String",
"uid": 129,
"type": "F_String",
"isArray": false,
"canBeNull": true,
"arrayMinLength": null,
"arrayMaxLength": null,
"editorDisplayMode": "Hidden",
"editorDisplayPos": "Above",
"editorAlwaysShow": false,
"editorCutLongValues": true,
"min": null,
"max": null,
"regex": null,
"acceptFileTypes": null,
"defaultOverride": null,
"textLanguageMode": null
},
{
"identifier": "Layer",
"__type": "LocalEnum.Layer",
"uid": 148,
"type": { "id": "F_Enum", "params": [141] },
"isArray": false,
"canBeNull": false,
"arrayMinLength": null,
"arrayMaxLength": null,
"editorDisplayMode": "Hidden",
"editorDisplayPos": "Above",
"editorAlwaysShow": false,
"editorCutLongValues": true,
"min": null,
"max": null,
"regex": null,
"acceptFileTypes": null,
"defaultOverride": null,
"textLanguageMode": null
}
]
},
{
"identifier": "Zone",
"uid": 123,
"tags": [],
"width": 8,
"height": 8,
"resizableX": true,
"resizableY": true,
"keepAspectRatio": false,
"fillOpacity": 0.31,
"lineOpacity": 1,
"hollow": false,
"color": "#772D8D",
"renderMode": "Rectangle",
"showName": true,
"tilesetId": null,
"tileId": null,
"tileRenderMode": "FitInside",
"maxCount": 0,
"limitScope": "PerLevel",
"limitBehavior": "MoveLastOne",
"pivotX": 0,
"pivotY": 0,
"fieldDefs": [
{
"identifier": "Name",
"__type": "String",
"uid": 128,
"type": "F_String",
"isArray": false,
"canBeNull": true,
"arrayMinLength": null,
"arrayMaxLength": null,
"editorDisplayMode": "ValueOnly",
"editorDisplayPos": "Above",
"editorAlwaysShow": false,
"editorCutLongValues": true,
"min": null,
"max": null,
"regex": null,
"acceptFileTypes": null,
"defaultOverride": null,
"textLanguageMode": null
},
{
"identifier": "Layer",
"__type": "LocalEnum.Layer",
"uid": 142,
"type": { "id": "F_Enum", "params": [141] },
"isArray": false,
"canBeNull": false,
"arrayMinLength": null,
"arrayMaxLength": null,
"editorDisplayMode": "Hidden",
"editorDisplayPos": "Above",
"editorAlwaysShow": false,
"editorCutLongValues": true,
"min": null,
"max": null,
"regex": null,
"acceptFileTypes": null,
"defaultOverride": null,
"textLanguageMode": null
}
]
},
{
"identifier": "CircleRegion",
"uid": 125,
"tags": ["region"],
"width": 16,
"height": 16,
"resizableX": true,
"resizableY": true,
"keepAspectRatio": true,
"fillOpacity": 1,
"lineOpacity": 1,
"hollow": true,
"color": "#94D9B3",
"renderMode": "Ellipse",
"showName": true,
"tilesetId": null,
"tileId": null,
"tileRenderMode": "FitInside",
"maxCount": 0,
"limitScope": "PerLevel",
"limitBehavior": "MoveLastOne",
"pivotX": 0.5,
"pivotY": 0.5,
"fieldDefs": []
},
{
"identifier": "Entity",
"uid": 126,
"tags": [],
"width": 16,
"height": 16,
"resizableX": false,
"resizableY": false,
"keepAspectRatio": false,
"fillOpacity": 1,
"lineOpacity": 1,
"hollow": false,
"color": "#94D9B3",
"renderMode": "Tile",
"showName": true,
"tilesetId": 9,
"tileId": 65,
"tileRenderMode": "FitInside",
"maxCount": 0,
"limitScope": "PerLevel",
"limitBehavior": "MoveLastOne",
"pivotX": 0,
"pivotY": 0,
"fieldDefs": [
{
"identifier": "Waypoints",
"__type": "Array<Point>",
"uid": 127,
"type": "F_Point",
"isArray": true,
"canBeNull": false,
"arrayMinLength": null,
"arrayMaxLength": null,
"editorDisplayMode": "PointPathLoop",
"editorDisplayPos": "Above",
"editorAlwaysShow": true,
"editorCutLongValues": true,
"min": null,
"max": null,
"regex": null,
"acceptFileTypes": null,
"defaultOverride": null,
"textLanguageMode": null
}
]
},
{
"identifier": "Light",
"uid": 130,
"tags": [],
"width": 16,
"height": 16,
"resizableX": false,
"resizableY": false,
"keepAspectRatio": false,
"fillOpacity": 1,
"lineOpacity": 1,
"hollow": false,
"color": "#94D9B3",
"renderMode": "Tile",
"showName": true,
"tilesetId": 9,
"tileId": 54,
"tileRenderMode": "FitInside",
"maxCount": 0,
"limitScope": "PerLevel",
"limitBehavior": "MoveLastOne",
"pivotX": 0,
"pivotY": 0,
"fieldDefs": []
},
{
"identifier": "Player",
"uid": 144,
"tags": [],
"width": 16,
"height": 32,
"resizableX": false,
"resizableY": false,
"keepAspectRatio": false,
"fillOpacity": 1,
"lineOpacity": 1,
"hollow": false,
"color": "#D62348",
"renderMode": "Tile",
"showName": true,
"tilesetId": 143,
"tileId": 2,
"tileRenderMode": "FitInside",
"maxCount": 0,
"limitScope": "PerLevel",
"limitBehavior": "MoveLastOne",
"pivotX": 0,
"pivotY": 0,
"fieldDefs": [
{
"identifier": "Layer",
"__type": "LocalEnum.Layer",
"uid": 147,
"type": { "id": "F_Enum", "params": [141] },
"isArray": false,
"canBeNull": false,
"arrayMinLength": null,
"arrayMaxLength": null,
"editorDisplayMode": "Hidden",
"editorDisplayPos": "Above",
"editorAlwaysShow": false,
"editorCutLongValues": true,
"min": null,
"max": null,
"regex": null,
"acceptFileTypes": null,
"defaultOverride": null,
"textLanguageMode": null
}
]
},
{
"identifier": "Animation",
"uid": 149,
"tags": [],
"width": 16,
"height": 16,
"resizableX": false,
"resizableY": false,
"keepAspectRatio": false,
"fillOpacity": 1,
"lineOpacity": 1,
"hollow": false,
"color": "#94D9B3",
"renderMode": "Tile",
"showName": true,
"tilesetId": 143,
"tileId": 0,
"tileRenderMode": "FitInside",
"maxCount": 0,
"limitScope": "PerLevel",
"limitBehavior": "MoveLastOne",
"pivotX": 0,
"pivotY": 0,
"fieldDefs": [
{
"identifier": "Frames",
"__type": "Int",
"uid": 150,
"type": "F_Int",
"isArray": false,
"canBeNull": false,
"arrayMinLength": null,
"arrayMaxLength": null,
"editorDisplayMode": "Hidden",
"editorDisplayPos": "Above",
"editorAlwaysShow": false,
"editorCutLongValues": true,
"min": null,
"max": null,
"regex": null,
"acceptFileTypes": null,
"defaultOverride": null,
"textLanguageMode": null
}
]
},
{
"identifier": "NPC",
"uid": 156,
"tags": [],
"width": 16,
"height": 16,
"resizableX": false,
"resizableY": false,
"keepAspectRatio": false,
"fillOpacity": 1,
"lineOpacity": 1,
"hollow": false,
"color": "#94D9B3",
"renderMode": "Tile",
"showName": true,
"tilesetId": 9,
"tileId": 64,
"tileRenderMode": "FitInside",
"maxCount": 0,
"limitScope": "PerLevel",
"limitBehavior": "MoveLastOne",
"pivotX": 0,
"pivotY": 0,
"fieldDefs": [
{
"identifier": "Layer",
"__type": "LocalEnum.Layer",
"uid": 158,
"type": { "id": "F_Enum", "params": [141] },
"isArray": false,
"canBeNull": false,
"arrayMinLength": null,
"arrayMaxLength": null,
"editorDisplayMode": "Hidden",
"editorDisplayPos": "Above",
"editorAlwaysShow": false,
"editorCutLongValues": true,
"min": null,
"max": null,
"regex": null,
"acceptFileTypes": null,
"defaultOverride": null,
"textLanguageMode": null
},
{
"identifier": "Dialog",
"__type": "Array<String>",
"uid": 157,
"type": "F_Text",
"isArray": true,
"canBeNull": true,
"arrayMinLength": null,
"arrayMaxLength": null,
"editorDisplayMode": "Hidden",
"editorDisplayPos": "Above",
"editorAlwaysShow": false,
"editorCutLongValues": true,
"min": null,
"max": null,
"regex": null,
"acceptFileTypes": null,
"defaultOverride": null,
"textLanguageMode": null
}
]
}
], "tilesets": [
{
"__cWid": 12,
"__cHei": 32,
"identifier": "Cavernas_by_Adam_Saltsman2",
"uid": 9,
"relPath": "atlas/Cavernas_by_Adam_Saltsman.png",
"pxWid": 96,
"pxHei": 256,
"tileGridSize": 8,
"spacing": 0,
"padding": 0,
"tagsSourceEnumUid": null,
"enumTags": [],
"customData": [],
"savedSelections": [
{ "ids": [0,1,2,3,4,5,6], "mode": "Random" },
{ "ids": [120,121,122], "mode": "Random" },
{ "ids": [56,57,58,59], "mode": "Random" },
{ "ids": [32,44,33,45,34,46,35,47], "mode": "Random" },
{ "ids": [9,10], "mode": "Random" },
{ "ids": [20,21,22], "mode": "Random" },
{ "ids": [25,40], "mode": "Random" },
{ "ids": [168,180], "mode": "Stamp" },
{ "ids": [169,181], "mode": "Stamp" },
{ "ids": [170,182], "mode": "Stamp" },
{ "ids": [156,157,158], "mode": "Random" },
{ "ids": [140,141], "mode": "Random" },
{ "ids": [142,143], "mode": "Random" },
{ "ids": [154,155], "mode": "Random" },
{ "ids": [152,153], "mode": "Random" },
{ "ids": [164,165], "mode": "Random" },
{ "ids": [], "mode": "Random" },
{ "ids": [], "mode": "Random" },
{ "ids": [], "mode": "Random" },
{ "ids": [], "mode": "Random" },
{ "ids": [252], "mode": "Random" }
],
"cachedPixelData": {
"opaqueTiles": "111111111111111111111110111111110000111111110000111111110000111111110000111111110000111111111000111111111100111111111100111111111100111111111111000111111111111001111100111000000000111000000000111000000000111000000000111100000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000000000000000000000000000000000000000000000000000000000000000000000000000",
"averageColors": "f123f224f224f224f224f224f224f224f333f324f323f434f573f453f343f666f666f334f544f544f334f334f3340000f343f223f233f334f445f555f644f2344336323563464346f343f233f233f334f223f778f223f5337335523553366346f224f666f667f974f654f654f533f5332564256435642454f334f236f445f644f544f634f434f3344235000000000000f235f236f334f644f433f223f764f6660000000000000000f447f233f224f223fa54f224f335f446f754000000000000f236f34af236f623fe41f555f999f888f644f54400000000f888f78bf888f679fea8fdccfaaaf556f434f12300000000f66af67bf67bf349fe97f453f343f334f654f54400000000f226f224f338f236f423f224f224f224f623f623f267f267711271237112f333f343f224f224f123f852f852f326f325f112f112f11200000000f224f224f224f777f77700000000f744f459f112000000000000000000000000000000000000f743f338f111000000000000000000000000000000000000f223f223f223000000000000000000000000000000000000f223f223f123000000000000000000000000000000000000f223f223f123f22400000000000000000000000000000000f243f233f343f235f123f235000000000000000000000000f233f343f343f224f235f235000000000000000000000000f233f644f333f123f224f224000000000000000000000000f233f754f444f123f224f224000000000000000000000000f233f754f434f123f224f224000000000000000000000000f233f754f444f123f224f224000000000000000000000000f123f864f434f123f235f224000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
},
{
"__cWid": 4,
"__cHei": 2,
"identifier": "Baba",
"uid": 143,
"relPath": "atlas/baba.png",
"pxWid": 128,
"pxHei": 64,
"tileGridSize": 32,
"spacing": 0,
"padding": 0,
"tagsSourceEnumUid": null,
"enumTags": [],
"customData": [],
"savedSelections": [],
"cachedPixelData": { "opaqueTiles": "00000000", "averageColors": "57565756476647663742374237423742" }
},
{
"__cWid": 4,
"__cHei": 4,
"identifier": "Trees",
"uid": 151,
"relPath": "atlas/treesssss.png",
"pxWid": 512,
"pxHei": 512,
"tileGridSize": 128,
"spacing": 20,
"padding": 20,
"tagsSourceEnumUid": null,
"enumTags": [],
"customData": [],
"savedSelections": [],
"cachedPixelData": { "opaqueTiles": "0001000100011111", "averageColors": "6763468586a50000000034751532000000000000000000000000000000000000" }
},
{
"__cWid": 16,
"__cHei": 16,
"identifier": "Zhabka",
"uid": 177,
"relPath": "atlas/zhabka.png",
"pxWid": 512,
"pxHei": 512,
"tileGridSize": 32,
"spacing": 0,
"padding": 0,
"tagsSourceEnumUid": null,
"enumTags": [],
"customData": [],
"savedSelections": [],
"cachedPixelData": {
"opaqueTiles": "0000110000000000011011000000000001100000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"averageColors": "09d507c409d47684f674f67376742dd22cc20000000015a514960000000000000884f674f6747643f643f74377434dd24cc2000086b5e6b5e5a59496000000000753f643f643177359b46ab408530000000036b5e6b5f6a4c6a57495000000000693c774c67408d449b449c4039654968496349635a5b56386a406b4000000000643f743f743000008a9379855a5f7b5f6b5b496038675420000000000000000074347434743000037a817a935a6e6a5e6a5a495038685320000000000000000000036b507b40878477415870000138685640386000055320000000000000000000026b526b506b3566427750db300005532000000000000000000000000000006b436b527b506b319b4558305a50000753200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
}
], "enums": [{ "identifier": "Layer", "uid": 141, "values": [ { "id": "Level", "tileId": 78, "color": 8019781, "__tileSrcRect": [48,48,8,8] }, { "id": "Patches", "tileId": 44, "color": 2896729, "__tileSrcRect": [64,24,8,8] } ], "iconTilesetUid": 9, "externalRelPath": null, "externalFileChecksum": null }], "externalEnums": [], "levelFields": [
{
"identifier": "tutorial",
"__type": "String",
"uid": 105,
"type": "F_Text",
"isArray": false,
"canBeNull": true,
"arrayMinLength": null,
"arrayMaxLength": null,
"editorDisplayMode": "ValueOnly",
"editorDisplayPos": "Above",
"editorAlwaysShow": false,
"editorCutLongValues": false,
"min": null,
"max": null,
"regex": null,
"acceptFileTypes": null,
"defaultOverride": null,
"textLanguageMode": null
},
{
"identifier": "color",
"__type": "Color",
"uid": 106,
"type": "F_Color",
"isArray": false,
"canBeNull": false,
"arrayMinLength": null,
"arrayMaxLength": null,
"editorDisplayMode": "Hidden",
"editorDisplayPos": "Above",
"editorAlwaysShow": false,
"editorCutLongValues": true,
"min": null,
"max": null,
"regex": null,
"acceptFileTypes": null,
"defaultOverride": { "id": "V_Int", "params": [16777215] },
"textLanguageMode": null
}
] },
"levels": [
{
"identifier": "Game",
"uid": 70,
"worldX": 0,
"worldY": 40,
"pxWid": 296,
"pxHei": 176,
"__bgColor": "#1E2027",
"bgColor": null,
"useAutoIdentifier": false,
"bgRelPath": null,
"bgPos": null,
"bgPivotX": 0.5,
"bgPivotY": 0.5,
"__bgPos": null,
"externalRelPath": null,
"fieldInstances": [
{
"__identifier": "tutorial",
"__value": "IntGrid layers can paint tiles automatically using simple RULE SETS.\n\n - Press \"SHIFT + R\" to toggle auto-layer rendering\n\n - Click on the RULES button on the left to see/edit rules.",
"__type": "String",
"defUid": 105,
"realEditorValues": [{
"id": "V_String",
"params": [
"IntGrid layers can paint tiles automatically using simple RULE SETS.\n\n - Press \"SHIFT + R\" to toggle auto-layer rendering\n\n - Click on the RULES button on the left to see/edit rules."
]
}]
},
{
"__identifier": "color",
"__value": "#FFB808",
"__type": "Color",
"defUid": 106,
"realEditorValues": [{ "id": "V_Int", "params": [16758792] }]
}
],
"layerInstances": [
{
"__identifier": "Dialog",
"__type": "IntGrid",
"__cWid": 37,
"__cHei": 22,
"__gridSize": 8,
"__opacity": 1,
"__pxTotalOffsetX": 0,
"__pxTotalOffsetY": 0,
"__tilesetDefUid": 9,
"__tilesetRelPath": "atlas/Cavernas_by_Adam_Saltsman.png",
"levelId": 70,
"layerDefUid": 159,
"pxOffsetX": 0,
"pxOffsetY": 0,
"visible": true,
"optionalRules": [],
"intGridCsv": [
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0
],
"autoLayerTiles": [],
"seed": 7674506,
"overrideTilesetUid": null,
"gridTiles": [],
"entityInstances": []
},
{
"__identifier": "Trees",
"__type": "Tiles",
"__cWid": 37,
"__cHei": 22,
"__gridSize": 8,
"__opacity": 1,
"__pxTotalOffsetX": 0,
"__pxTotalOffsetY": 0,
"__tilesetDefUid": 151,
"__tilesetRelPath": "atlas/treesssss.png",
"levelId": 70,
"layerDefUid": 155,
"pxOffsetX": 0,
"pxOffsetY": 0,
"visible": true,
"optionalRules": [],
"intGridCsv": [],
"autoLayerTiles": [],
"seed": 3739032,
"overrideTilesetUid": null,
"gridTiles": [
{ "px": [176,0], "src": [316,20], "f": 0, "t": 2, "d": [22] },
{ "px": [184,112], "src": [316,168], "f": 0, "t": 6, "d": [541] }
],
"entityInstances": []
},
{
"__identifier": "Entities",
"__type": "Entities",
"__cWid": 37,
"__cHei": 22,
"__gridSize": 8,
"__opacity": 1,
"__pxTotalOffsetX": 0,
"__pxTotalOffsetY": 0,
"__tilesetDefUid": null,
"__tilesetRelPath": null,
"levelId": 70,
"layerDefUid": 109,
"pxOffsetX": 0,
"pxOffsetY": 0,
"visible": true,
"optionalRules": [],
"intGridCsv": [],
"autoLayerTiles": [],
"seed": 6131666,
"overrideTilesetUid": null,
"gridTiles": [],
"entityInstances": [
{
"__identifier": "Key",
"__grid": [5,11],
"__pivot": [0,0],
"__tile": { "tilesetUid": 9, "srcRect": [40,24,8,8] },
"width": 8,
"height": 8,
"defUid": 108,
"px": [40,88],
"fieldInstances": [
{
"__identifier": "action1",
"__value": { "cx": 8, "cy": 9 },
"__type": "Point",
"defUid": 122,
"realEditorValues": [{
"id": "V_String",
"params": ["8,9"]
}]
},
{
"__identifier": "onInterract",
"__value": "hide(\"Hole\")",
"__type": "String",
"defUid": 129,
"realEditorValues": [{
"id": "V_String",
"params": ["hide(\"Hole\")"]
}]
},
{
"__identifier": "Layer",
"__value": "Level",
"__type": "LocalEnum.Layer",
"defUid": 148,
"realEditorValues": [{
"id": "V_String",
"params": ["Level"]
}]
}
]
},
{
"__identifier": "Zone",
"__grid": [8,6],
"__pivot": [0,0],
"__tile": null,
"width": 16,
"height": 48,
"defUid": 123,
"px": [64,48],
"fieldInstances": [
{
"__identifier": "Name",
"__value": "Hole",
"__type": "String",
"defUid": 128,
"realEditorValues": [{
"id": "V_String",
"params": ["Hole"]
}]
},
{
"__identifier": "Layer",
"__value": "Patches",
"__type": "LocalEnum.Layer",
"defUid": 142,
"realEditorValues": [{
"id": "V_String",
"params": ["Patches"]
}]
}
]
},
{
"__identifier": "CircleRegion",
"__grid": [27,9],
"__pivot": [0.5,0.5],
"__tile": null,
"width": 88,
"height": 88,
"defUid": 125,
"px": [220,76],
"fieldInstances": []
},
{
"__identifier": "Entity",
"__grid": [7,17],
"__pivot": [0,0],
"__tile": { "tilesetUid": 9, "srcRect": [40,40,8,8] },
"width": 16,
"height": 16,
"defUid": 126,
"px": [56,136],
"fieldInstances": [{
"__identifier": "Waypoints",
"__value": [
{ "cx": 7, "cy": 20 },
{ "cx": 10, "cy": 20 },
{ "cx": 21, "cy": 20 },
{ "cx": 9, "cy": 16 },
{ "cx": 4, "cy": 16 },
{ "cx": 1, "cy": 17 }
],
"__type": "Array<Point>",
"defUid": 127,
"realEditorValues": [
{
"id": "V_String",
"params": ["7,20"]
},
{
"id": "V_String",
"params": ["10,20"]
},
{
"id": "V_String",
"params": ["21,20"]
},
{
"id": "V_String",
"params": ["9,16"]
},
{
"id": "V_String",
"params": ["4,16"]
},
{
"id": "V_String",
"params": ["1,17"]
}
]
}]
},
{
"__identifier": "Player",
"__grid": [2,9],
"__pivot": [0,0],
"__tile": { "tilesetUid": 143, "srcRect": [64,0,32,32] },
"width": 16,
"height": 32,
"defUid": 144,
"px": [16,72],
"fieldInstances": [{
"__identifier": "Layer",
"__value": "Level",
"__type": "LocalEnum.Layer",
"defUid": 147,
"realEditorValues": [{
"id": "V_String",
"params": ["Level"]
}]
}]
},
{
"__identifier": "NPC",
"__grid": [16,5],
"__pivot": [0,0],
"__tile": { "tilesetUid": 9, "srcRect": [32,40,8,8] },
"width": 16,
"height": 16,
"defUid": 156,
"px": [128,40],
"fieldInstances": [
{
"__identifier": "Dialog",
"__value": [
"Привет!",
"Камни любят тебя!",
"Внизу лежит богомерзкий мусор.\nЕго разбросали какие-то \nНЕОПИСУЕМЫЕ СВИНОТЫ\nСейчас я открою проход.[>openPassage]"
],
"__type": "Array<String>",
"defUid": 157,
"realEditorValues": [ {
"id": "V_String",
"params": ["Привет!"]
}, {
"id": "V_String",
"params": ["Камни любят тебя!"]
}, {
"id": "V_String",
"params": [
"Внизу лежит богомерзкий мусор.\nЕго разбросали какие-то \nНЕОПИСУЕМЫЕ СВИНОТЫ\nСейчас я открою проход.[>openPassage]"
]
} ]
},
{
"__identifier": "Layer",
"__value": "Level",
"__type": "LocalEnum.Layer",
"defUid": 158,
"realEditorValues": [{
"id": "V_String",
"params": ["Level"]
}]
}
]
},
{
"__identifier": "Zone",
"__grid": [19,5],
"__pivot": [0,0],
"__tile": null,
"width": 16,
"height": 16,
"defUid": 123,
"px": [152,40],
"fieldInstances": [
{
"__identifier": "Name",
"__value": "RocksPassage",
"__type": "String",
"defUid": 128,
"realEditorValues": [{
"id": "V_String",
"params": ["RocksPassage"]
}]
},
{
"__identifier": "Layer",
"__value": "Patches",
"__type": "LocalEnum.Layer",
"defUid": 142,
"realEditorValues": [{
"id": "V_String",
"params": ["Patches"]
}]
}
]
}
]
},
{
"__identifier": "Patches",
"__type": "IntGrid",
"__cWid": 37,
"__cHei": 22,
"__gridSize": 8,
"__opacity": 1,
"__pxTotalOffsetX": 0,
"__pxTotalOffsetY": 0,
"__tilesetDefUid": 9,
"__tilesetRelPath": "atlas/Cavernas_by_Adam_Saltsman.png",
"levelId": 70,
"layerDefUid": 110,
"pxOffsetX": 0,
"pxOffsetY": 0,
"visible": true,
"optionalRules": [],
"intGridCsv": [
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0
],
"autoLayerTiles": [
{ "px": [152,48], "src": [24,40], "f": 0, "t": 63, "d": [120,241] },
{ "px": [72,64], "src": [24,40], "f": 0, "t": 63, "d": [120,305] },
{ "px": [64,80], "src": [24,40], "f": 0, "t": 63, "d": [120,378] },
{ "px": [160,48], "src": [24,48], "f": 1, "t": 75, "d": [117,242] },
{ "px": [152,56], "src": [24,48], "f": 0, "t": 75, "d": [117,278] },
{ "px": [72,72], "src": [24,48], "f": 1, "t": 75, "d": [117,342] },
{ "px": [64,88], "src": [24,48], "f": 0, "t": 75, "d": [117,415] },
{ "px": [152,40], "src": [24,32], "f": 0, "t": 51, "d": [116,204] },
{ "px": [160,40], "src": [24,32], "f": 1, "t": 51, "d": [116,205] },
{ "px": [72,56], "src": [24,32], "f": 0, "t": 51, "d": [116,268] },
{ "px": [64,72], "src": [24,32], "f": 0, "t": 51, "d": [116,341] },
{ "px": [112,80], "src": [64,56], "f": 0, "t": 92, "d": [115,384] },
{ "px": [72,48], "src": [32,40], "f": 0, "t": 64, "d": [114,231] },
{ "px": [64,64], "src": [32,40], "f": 0, "t": 64, "d": [114,304] },
{ "px": [160,56], "src": [32,96], "f": 0, "t": 148, "d": [112,279] },
{ "px": [72,80], "src": [48,80], "f": 0, "t": 126, "d": [112,379] },
{ "px": [112,88], "src": [56,80], "f": 0, "t": 127, "d": [112,421] },
{ "px": [64,96], "src": [48,80], "f": 0, "t": 126, "d": [112,452] }
],
"seed": 6041390,
"overrideTilesetUid": null,
"gridTiles": [],
"entityInstances": []
},
{
"__identifier": "Level",
"__type": "IntGrid",
"__cWid": 37,
"__cHei": 22,
"__gridSize": 8,
"__opacity": 1,
"__pxTotalOffsetX": 0,
"__pxTotalOffsetY": 0,
"__tilesetDefUid": 9,
"__tilesetRelPath": "atlas/Cavernas_by_Adam_Saltsman.png",
"levelId": 70,
"layerDefUid": 72,
"pxOffsetX": 0,
"pxOffsetY": 0,
"visible": true,
"optionalRules": [],
"intGridCsv": [
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,1,0,0,1,1,0,0,0,1,1,1,0,0,1,1,1,0,0,1,1,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,0,1,0,1,0,1,0,0,0,0,1,1,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,1,1,1,0,0,0,0,1,1,1,1,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,0,
0,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,
0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,1,1,0,0,0,1,
1,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0
],
"autoLayerTiles": [
{ "px": [16,104], "src": [48,0], "f": 0, "t": 6, "d": [73,483] },
{ "px": [48,104], "src": [40,0], "f": 0, "t": 5, "d": [73,487] },
{ "px": [192,104], "src": [24,0], "f": 0, "t": 3, "d": [73,505] },
{ "px": [32,32], "src": [24,40], "f": 0, "t": 63, "d": [81,152] },
{ "px": [40,32], "src": [24,40], "f": 1, "t": 63, "d": [81,153] },
{ "px": [80,32], "src": [24,40], "f": 0, "t": 63, "d": [81,158] },
{ "px": [8,96], "src": [24,40], "f": 0, "t": 63, "d": [81,445] },
{ "px": [8,104], "src": [24,40], "f": 0, "t": 63, "d": [81,482] },
{ "px": [56,104], "src": [24,40], "f": 1, "t": 63, "d": [81,488] },
{ "px": [80,40], "src": [32,48], "f": 0, "t": 76, "d": [84,195] },
{ "px": [24,104], "src": [32,48], "f": 0, "t": 76, "d": [84,484] },
{ "px": [32,104], "src": [32,48], "f": 0, "t": 76, "d": [84,485] },
{ "px": [40,104], "src": [32,48], "f": 0, "t": 76, "d": [84,486] },
{ "px": [184,112], "src": [32,48], "f": 0, "t": 76, "d": [84,541] },
{ "px": [192,112], "src": [32,48], "f": 0, "t": 76, "d": [84,542] },
{ "px": [200,112], "src": [32,48], "f": 0, "t": 76, "d": [84,543] },
{ "px": [224,112], "src": [32,48], "f": 0, "t": 76, "d": [84,546] },
{ "px": [232,112], "src": [32,48], "f": 0, "t": 76, "d": [84,547] },
{ "px": [240,112], "src": [32,48], "f": 0, "t": 76, "d": [84,548] },
{ "px": [80,24], "src": [32,32], "f": 0, "t": 52, "d": [76,121] },
{ "px": [16,96], "src": [32,32], "f": 0, "t": 52, "d": [76,446] },
{ "px": [24,96], "src": [32,32], "f": 0, "t": 52, "d": [76,447] },
{ "px": [32,96], "src": [32,32], "f": 0, "t": 52, "d": [76,448] },
{ "px": [40,96], "src": [32,32], "f": 0, "t": 52, "d": [76,449] },
{ "px": [48,96], "src": [32,32], "f": 0, "t": 52, "d": [76,450] },
{ "px": [56,96], "src": [32,32], "f": 0, "t": 52, "d": [76,451] },
{ "px": [232,104], "src": [32,32], "f": 0, "t": 52, "d": [76,510] },
{ "px": [128,24], "src": [24,48], "f": 1, "t": 75, "d": [83,127] },
{ "px": [112,32], "src": [24,48], "f": 0, "t": 75, "d": [83,162] },
{ "px": [152,32], "src": [24,48], "f": 0, "t": 75, "d": [83,167] },
{ "px": [160,32], "src": [24,48], "f": 1, "t": 75, "d": [83,168] },
{ "px": [32,40], "src": [24,48], "f": 0, "t": 75, "d": [83,189] },
{ "px": [40,40], "src": [24,48], "f": 1, "t": 75, "d": [83,190] },
{ "px": [64,40], "src": [24,48], "f": 0, "t": 75, "d": [83,193] },
{ "px": [96,40], "src": [24,48], "f": 1, "t": 75, "d": [83,197] },
{ "px": [128,64], "src": [24,48], "f": 1, "t": 75, "d": [83,312] },
{ "px": [120,72], "src": [24,48], "f": 1, "t": 75, "d": [83,348] },
{ "px": [112,80], "src": [24,48], "f": 1, "t": 75, "d": [83,384] },
{ "px": [88,88], "src": [24,48], "f": 1, "t": 75, "d": [83,418] },
{ "px": [72,96], "src": [24,48], "f": 1, "t": 75, "d": [83,453] },
{ "px": [8,112], "src": [24,48], "f": 0, "t": 75, "d": [83,519] },
{ "px": [16,112], "src": [24,48], "f": 1, "t": 75, "d": [83,520] },
{ "px": [48,112], "src": [24,48], "f": 0, "t": 75, "d": [83,524] },
{ "px": [56,112], "src": [24,48], "f": 1, "t": 75, "d": [83,525] },
{ "px": [136,112], "src": [24,48], "f": 1, "t": 75, "d": [83,535] },
{ "px": [152,112], "src": [24,48], "f": 0, "t": 75, "d": [83,537] },
{ "px": [128,16], "src": [24,32], "f": 0, "t": 51, "d": [82,90] },
{ "px": [32,24], "src": [24,32], "f": 0, "t": 51, "d": [82,115] },
{ "px": [40,24], "src": [24,32], "f": 1, "t": 51, "d": [82,116] },
{ "px": [112,24], "src": [24,32], "f": 0, "t": 51, "d": [82,125] },
{ "px": [152,24], "src": [24,32], "f": 0, "t": 51, "d": [82,130] },
{ "px": [160,24], "src": [24,32], "f": 1, "t": 51, "d": [82,131] },
{ "px": [64,32], "src": [24,32], "f": 0, "t": 51, "d": [82,156] },
{ "px": [96,32], "src": [24,32], "f": 0, "t": 51, "d": [82,160] },
{ "px": [128,56], "src": [24,32], "f": 0, "t": 51, "d": [82,275] },
{ "px": [120,64], "src": [24,32], "f": 0, "t": 51, "d": [82,311] },
{ "px": [112,72], "src": [24,32], "f": 0, "t": 51, "d": [82,347] },
{ "px": [88,80], "src": [24,32], "f": 0, "t": 51, "d": [82,381] },
{ "px": [8,88], "src": [24,32], "f": 0, "t": 51, "d": [82,408] },
{ "px": [72,88], "src": [24,32], "f": 0, "t": 51, "d": [82,416] },
{ "px": [192,96], "src": [24,32], "f": 0, "t": 51, "d": [82,468] },
{ "px": [136,104], "src": [24,32], "f": 0, "t": 51, "d": [82,498] },
{ "px": [152,104], "src": [24,32], "f": 1, "t": 51, "d": [82,500] },
{ "px": [184,104], "src": [24,32], "f": 0, "t": 51, "d": [82,504] },
{ "px": [200,104], "src": [24,32], "f": 1, "t": 51, "d": [82,506] },
{ "px": [224,104], "src": [24,32], "f": 0, "t": 51, "d": [82,509] },
{ "px": [240,104], "src": [24,32], "f": 1, "t": 51, "d": [82,511] },
{ "px": [8,8], "src": [64,56], "f": 0, "t": 92, "d": [98,38] },
{ "px": [136,16], "src": [64,56], "f": 0, "t": 92, "d": [98,91] },
{ "px": [8,24], "src": [64,56], "f": 0, "t": 92, "d": [98,112] },
{ "px": [72,24], "src": [64,56], "f": 0, "t": 92, "d": [98,120] },
{ "px": [88,24], "src": [64,56], "f": 0, "t": 92, "d": [98,122] },
{ "px": [120,24], "src": [64,56], "f": 0, "t": 92, "d": [98,126] },
{ "px": [8,40], "src": [64,56], "f": 0, "t": 92, "d": [98,186] },
{ "px": [72,40], "src": [64,56], "f": 0, "t": 92, "d": [98,194] },
{ "px": [88,40], "src": [64,56], "f": 0, "t": 92, "d": [98,196] },
{ "px": [8,56], "src": [64,56], "f": 0, "t": 92, "d": [98,260] },
{ "px": [32,56], "src": [64,56], "f": 0, "t": 92, "d": [98,263] },
{ "px": [72,56], "src": [64,56], "f": 0, "t": 92, "d": [98,268] },
{ "px": [80,56], "src": [64,56], "f": 0, "t": 92, "d": [98,269] },
{ "px": [88,56], "src": [64,56], "f": 0, "t": 92, "d": [98,270] },
{ "px": [136,56], "src": [64,56], "f": 0, "t": 92, "d": [98,276] },
{ "px": [144,56], "src": [64,56], "f": 0, "t": 92, "d": [98,277] },
{ "px": [152,56], "src": [64,56], "f": 0, "t": 92, "d": [98,278] },
{ "px": [8,72], "src": [64,56], "f": 0, "t": 92, "d": [98,334] },
{ "px": [96,80], "src": [64,56], "f": 0, "t": 92, "d": [98,382] },
{ "px": [104,80], "src": [64,56], "f": 0, "t": 92, "d": [98,383] },
{ "px": [160,80], "src": [64,56], "f": 0, "t": 92, "d": [98,390] },
{ "px": [80,88], "src": [64,56], "f": 0, "t": 92, "d": [98,417] },
{ "px": [128,88], "src": [64,56], "f": 0, "t": 92, "d": [98,423] },
{ "px": [136,88], "src": [64,56], "f": 0, "t": 92, "d": [98,424] },
{ "px": [168,88], "src": [64,56], "f": 0, "t": 92, "d": [98,428] },
{ "px": [64,96], "src": [64,56], "f": 0, "t": 92, "d": [98,452] },
{ "px": [144,104], "src": [64,56], "f": 0, "t": 92, "d": [98,499] },
{ "px": [128,112], "src": [64,56], "f": 0, "t": 92, "d": [98,534] },
{ "px": [160,112], "src": [64,56], "f": 0, "t": 92, "d": [98,538] },
{ "px": [168,112], "src": [64,56], "f": 0, "t": 92, "d": [98,539] },
{ "px": [176,112], "src": [64,56], "f": 0, "t": 92, "d": [98,540] },
{ "px": [208,112], "src": [64,56], "f": 0, "t": 92, "d": [98,544] },
{ "px": [216,112], "src": [64,56], "f": 0, "t": 92, "d": [98,545] },
{ "px": [248,112], "src": [64,56], "f": 0, "t": 92, "d": [98,549] },
{ "px": [256,112], "src": [64,56], "f": 0, "t": 92, "d": [98,550] },
{ "px": [136,8], "src": [32,40], "f": 0, "t": 64, "d": [95,54] },
{ "px": [80,16], "src": [32,40], "f": 0, "t": 64, "d": [95,84] },
{ "px": [64,24], "src": [32,40], "f": 0, "t": 64, "d": [95,119] },
{ "px": [152,48], "src": [32,40], "f": 0, "t": 64, "d": [95,241] },
{ "px": [88,72], "src": [32,40], "f": 0, "t": 64, "d": [95,344] },
{ "px": [128,80], "src": [32,40], "f": 0, "t": 64, "d": [95,386] },
{ "px": [168,80], "src": [32,40], "f": 0, "t": 64, "d": [95,391] },
{ "px": [40,88], "src": [32,40], "f": 0, "t": 64, "d": [95,412] },
{ "px": [144,96], "src": [32,40], "f": 0, "t": 64, "d": [95,462] },
{ "px": [184,96], "src": [32,40], "f": 0, "t": 64, "d": [95,467] },
{ "px": [160,104], "src": [32,40], "f": 0, "t": 64, "d": [95,501] },
{ "px": [176,104], "src": [32,40], "f": 0, "t": 64, "d": [95,503] },
{ "px": [8,16], "src": [24,96], "f": 0, "t": 147, "d": [99,75] },
{ "px": [136,24], "src": [24,96], "f": 0, "t": 147, "d": [99,128] },
{ "px": [8,32], "src": [32,96], "f": 0, "t": 148, "d": [99,149] },
{ "px": [72,32], "src": [56,80], "f": 0, "t": 127, "d": [99,157] },
{ "px": [88,32], "src": [56,80], "f": 0, "t": 127, "d": [99,159] },
{ "px": [120,32], "src": [24,96], "f": 0, "t": 147, "d": [99,163] },
{ "px": [112,40], "src": [24,96], "f": 0, "t": 147, "d": [99,199] },
{ "px": [152,40], "src": [48,80], "f": 0, "t": 126, "d": [99,204] },
{ "px": [160,40], "src": [56,80], "f": 0, "t": 127, "d": [99,205] },
{ "px": [32,48], "src": [56,80], "f": 0, "t": 127, "d": [99,226] },
{ "px": [40,48], "src": [24,96], "f": 0, "t": 147, "d": [99,227] },
{ "px": [64,48], "src": [48,80], "f": 0, "t": 126, "d": [99,230] },
{ "px": [80,48], "src": [48,80], "f": 0, "t": 126, "d": [99,232] },
{ "px": [88,48], "src": [56,80], "f": 0, "t": 127, "d": [99,233] },
{ "px": [96,48], "src": [48,80], "f": 0, "t": 126, "d": [99,234] },
{ "px": [32,64], "src": [48,80], "f": 0, "t": 126, "d": [99,300] },
{ "px": [88,64], "src": [24,96], "f": 0, "t": 147, "d": [99,307] },
{ "px": [152,64], "src": [32,96], "f": 0, "t": 148, "d": [99,315] },
{ "px": [128,72], "src": [56,80], "f": 0, "t": 127, "d": [99,349] },
{ "px": [8,80], "src": [48,80], "f": 0, "t": 126, "d": [99,371] },
{ "px": [112,88], "src": [48,80], "f": 0, "t": 126, "d": [99,421] },
{ "px": [160,88], "src": [24,96], "f": 0, "t": 147, "d": [99,427] },
{ "px": [80,96], "src": [24,96], "f": 0, "t": 147, "d": [99,454] },
{ "px": [88,96], "src": [48,80], "f": 0, "t": 126, "d": [99,455] },
{ "px": [128,96], "src": [48,80], "f": 0, "t": 126, "d": [99,460] },
{ "px": [136,96], "src": [24,96], "f": 0, "t": 147, "d": [99,461] },
{ "px": [168,96], "src": [24,96], "f": 0, "t": 147, "d": [99,465] },
{ "px": [72,104], "src": [32,96], "f": 0, "t": 148, "d": [99,490] },
{ "px": [24,112], "src": [32,96], "f": 0, "t": 148, "d": [99,521] },
{ "px": [32,112], "src": [24,96], "f": 0, "t": 147, "d": [99,522] },
{ "px": [40,112], "src": [48,80], "f": 0, "t": 126, "d": [99,523] },
{ "px": [8,120], "src": [32,96], "f": 0, "t": 148, "d": [99,556] },
{ "px": [48,120], "src": [24,96], "f": 0, "t": 147, "d": [99,561] },
{ "px": [56,120], "src": [56,80], "f": 0, "t": 127, "d": [99,562] },
{ "px": [160,120], "src": [24,96], "f": 0, "t": 147, "d": [99,575] },
{ "px": [168,120], "src": [48,80], "f": 0, "t": 126, "d": [99,576] },
{ "px": [176,120], "src": [32,96], "f": 0, "t": 148, "d": [99,577] },
{ "px": [184,120], "src": [56,80], "f": 0, "t": 127, "d": [99,578] },
{ "px": [192,120], "src": [24,96], "f": 0, "t": 147, "d": [99,579] },
{ "px": [200,120], "src": [24,96], "f": 0, "t": 147, "d": [99,580] },
{ "px": [216,120], "src": [48,80], "f": 0, "t": 126, "d": [99,582] },
{ "px": [232,120], "src": [56,80], "f": 0, "t": 127, "d": [99,584] },
{ "px": [240,120], "src": [32,96], "f": 0, "t": 148, "d": [99,585] },
{ "px": [248,120], "src": [32,96], "f": 0, "t": 148, "d": [99,586] },
{ "px": [256,120], "src": [24,96], "f": 0, "t": 147, "d": [99,587] }
],
"seed": 6134941,
"overrideTilesetUid": null,
"gridTiles": [],
"entityInstances": []
},
{
"__identifier": "Background",
"__type": "IntGrid",
"__cWid": 37,
"__cHei": 22,
"__gridSize": 8,
"__opacity": 1,
"__pxTotalOffsetX": 0,
"__pxTotalOffsetY": 0,
"__tilesetDefUid": 9,
"__tilesetRelPath": "atlas/Cavernas_by_Adam_Saltsman.png",
"levelId": 70,
"layerDefUid": 133,
"pxOffsetX": 0,
"pxOffsetY": 0,
"visible": true,
"optionalRules": [],
"intGridCsv": [
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,
0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0
],
"autoLayerTiles": [
{ "px": [16,24], "src": [8,0], "f": 0, "t": 1, "d": [136,113] },
{ "px": [24,48], "src": [8,0], "f": 0, "t": 1, "d": [136,225] },
{ "px": [8,64], "src": [8,0], "f": 0, "t": 1, "d": [136,297] },
{ "px": [16,80], "src": [8,0], "f": 0, "t": 1, "d": [136,372] },
{ "px": [144,80], "src": [8,0], "f": 0, "t": 1, "d": [136,388] },
{ "px": [136,104], "src": [8,0], "f": 0, "t": 1, "d": [136,498] },
{ "px": [88,112], "src": [8,0], "f": 0, "t": 1, "d": [136,529] },
{ "px": [40,136], "src": [8,0], "f": 0, "t": 1, "d": [136,634] },
{ "px": [128,136], "src": [8,0], "f": 0, "t": 1, "d": [136,645] },
{ "px": [96,144], "src": [8,0], "f": 0, "t": 1, "d": [136,678] },
{ "px": [56,152], "src": [8,0], "f": 0, "t": 1, "d": [136,710] },
{ "px": [16,32], "src": [48,0], "f": 0, "t": 6, "d": [137,150] },
{ "px": [56,40], "src": [48,0], "f": 0, "t": 6, "d": [137,192] },
{ "px": [40,64], "src": [48,0], "f": 0, "t": 6, "d": [137,301] },
{ "px": [8,72], "src": [48,0], "f": 0, "t": 6, "d": [137,334] },
{ "px": [56,80], "src": [48,0], "f": 0, "t": 6, "d": [137,377] },
{ "px": [144,88], "src": [48,0], "f": 0, "t": 6, "d": [137,425] },
{ "px": [88,120], "src": [48,0], "f": 0, "t": 6, "d": [137,566] },
{ "px": [120,8], "src": [24,0], "f": 0, "t": 3, "d": [138,52] },
{ "px": [128,8], "src": [24,0], "f": 0, "t": 3, "d": [138,53] },
{ "px": [120,16], "src": [24,0], "f": 0, "t": 3, "d": [138,89] },
{ "px": [128,16], "src": [24,0], "f": 0, "t": 3, "d": [138,90] },
{ "px": [120,24], "src": [24,0], "f": 0, "t": 3, "d": [138,126] },
{ "px": [128,24], "src": [24,0], "f": 0, "t": 3, "d": [138,127] },
{ "px": [112,32], "src": [24,0], "f": 0, "t": 3, "d": [138,162] },
{ "px": [120,32], "src": [24,0], "f": 0, "t": 3, "d": [138,163] },
{ "px": [128,32], "src": [24,0], "f": 0, "t": 3, "d": [138,164] },
{ "px": [112,40], "src": [24,0], "f": 0, "t": 3, "d": [138,199] },
{ "px": [120,40], "src": [24,0], "f": 0, "t": 3, "d": [138,200] },
{ "px": [112,48], "src": [24,0], "f": 0, "t": 3, "d": [138,236] },
{ "px": [120,48], "src": [24,0], "f": 0, "t": 3, "d": [138,237] },
{ "px": [32,56], "src": [24,0], "f": 0, "t": 3, "d": [138,263] },
{ "px": [40,8], "src": [32,0], "f": 0, "t": 4, "d": [139,42] },
{ "px": [112,8], "src": [32,0], "f": 0, "t": 4, "d": [139,51] },
{ "px": [112,16], "src": [32,0], "f": 0, "t": 4, "d": [139,88] },
{ "px": [112,24], "src": [32,0], "f": 0, "t": 4, "d": [139,125] },
{ "px": [48,32], "src": [32,0], "f": 0, "t": 4, "d": [139,154] },
{ "px": [104,32], "src": [32,0], "f": 0, "t": 4, "d": [139,161] },
{ "px": [104,40], "src": [32,0], "f": 0, "t": 4, "d": [139,198] },
{ "px": [104,48], "src": [32,0], "f": 0, "t": 4, "d": [139,235] },
{ "px": [24,56], "src": [32,0], "f": 0, "t": 4, "d": [139,262] },
{ "px": [112,56], "src": [32,0], "f": 0, "t": 4, "d": [139,273] },
{ "px": [48,72], "src": [32,0], "f": 0, "t": 4, "d": [139,339] },
{ "px": [48,8], "src": [32,0], "f": 0, "t": 4, "d": [140,43] },
{ "px": [136,8], "src": [32,0], "f": 0, "t": 4, "d": [140,54] },
{ "px": [136,16], "src": [32,0], "f": 0, "t": 4, "d": [140,91] },
{ "px": [136,24], "src": [32,0], "f": 0, "t": 4, "d": [140,128] },
{ "px": [56,32], "src": [32,0], "f": 0, "t": 4, "d": [140,155] },
{ "px": [136,32], "src": [32,0], "f": 0, "t": 4, "d": [140,165] },
{ "px": [128,40], "src": [32,0], "f": 0, "t": 4, "d": [140,201] },
{ "px": [128,48], "src": [32,0], "f": 0, "t": 4, "d": [140,238] },
{ "px": [40,56], "src": [32,0], "f": 0, "t": 4, "d": [140,264] },
{ "px": [120,56], "src": [32,0], "f": 0, "t": 4, "d": [140,274] },
{ "px": [56,72], "src": [32,0], "f": 0, "t": 4, "d": [140,340] }
],
"seed": 291520,
"overrideTilesetUid": null,
"gridTiles": [],
"entityInstances": []
}
],
"__neighbours": []
},
{
"identifier": "Dialog",
"uid": 171,
"worldX": 2,
"worldY": 276,
"pxWid": 200,
"pxHei": 120,
"__bgColor": "#1E2027",
"bgColor": null,
"useAutoIdentifier": false,
"bgRelPath": null,
"bgPos": null,
"bgPivotX": 0.5,
"bgPivotY": 0.5,
"__bgPos": null,
"externalRelPath": null,
"fieldInstances": [
{ "__identifier": "tutorial", "__value": null, "__type": "String", "defUid": 105, "realEditorValues": [] },
{ "__identifier": "color", "__value": "#FFFFFF", "__type": "Color", "defUid": 106, "realEditorValues": [] }
],
"layerInstances": [
{
"__identifier": "Dialog",
"__type": "IntGrid",
"__cWid": 25,
"__cHei": 15,
"__gridSize": 8,
"__opacity": 1,
"__pxTotalOffsetX": 0,
"__pxTotalOffsetY": 0,
"__tilesetDefUid": 9,
"__tilesetRelPath": "atlas/Cavernas_by_Adam_Saltsman.png",
"levelId": 171,
"layerDefUid": 159,
"pxOffsetX": 0,
"pxOffsetY": 0,
"visible": true,
"optionalRules": [],
"intGridCsv": [
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,
0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,
0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,
0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
],
"autoLayerTiles": [
{ "px": [48,40], "src": [72,72], "f": 0, "t": 117, "d": [163,131] },
{ "px": [56,40], "src": [72,72], "f": 0, "t": 117, "d": [163,132] },
{ "px": [64,40], "src": [72,72], "f": 0, "t": 117, "d": [163,133] },
{ "px": [72,40], "src": [72,72], "f": 0, "t": 117, "d": [163,134] },
{ "px": [80,40], "src": [72,72], "f": 0, "t": 117, "d": [163,135] },
{ "px": [88,40], "src": [72,72], "f": 0, "t": 117, "d": [163,136] },
{ "px": [96,40], "src": [72,72], "f": 0, "t": 117, "d": [163,137] },
{ "px": [104,40], "src": [72,72], "f": 0, "t": 117, "d": [163,138] },
{ "px": [112,40], "src": [72,72], "f": 0, "t": 117, "d": [163,139] },
{ "px": [120,40], "src": [72,72], "f": 0, "t": 117, "d": [163,140] },
{ "px": [128,40], "src": [72,72], "f": 0, "t": 117, "d": [163,141] },
{ "px": [136,40], "src": [72,72], "f": 0, "t": 117, "d": [163,142] },
{ "px": [48,48], "src": [72,72], "f": 0, "t": 117, "d": [163,156] },
{ "px": [56,48], "src": [72,72], "f": 0, "t": 117, "d": [163,157] },
{ "px": [64,48], "src": [72,72], "f": 0, "t": 117, "d": [163,158] },
{ "px": [72,48], "src": [72,72], "f": 0, "t": 117, "d": [163,159] },
{ "px": [80,48], "src": [72,72], "f": 0, "t": 117, "d": [163,160] },
{ "px": [88,48], "src": [72,72], "f": 0, "t": 117, "d": [163,161] },
{ "px": [96,48], "src": [72,72], "f": 0, "t": 117, "d": [163,162] },
{ "px": [104,48], "src": [72,72], "f": 0, "t": 117, "d": [163,163] },
{ "px": [112,48], "src": [72,72], "f": 0, "t": 117, "d": [163,164] },
{ "px": [120,48], "src": [72,72], "f": 0, "t": 117, "d": [163,165] },
{ "px": [128,48], "src": [72,72], "f": 0, "t": 117, "d": [163,166] },
{ "px": [136,48], "src": [72,72], "f": 0, "t": 117, "d": [163,167] },
{ "px": [48,56], "src": [72,72], "f": 0, "t": 117, "d": [163,181] },
{ "px": [56,56], "src": [72,72], "f": 0, "t": 117, "d": [163,182] },
{ "px": [64,56], "src": [72,72], "f": 0, "t": 117, "d": [163,183] },
{ "px": [72,56], "src": [72,72], "f": 0, "t": 117, "d": [163,184] },
{ "px": [80,56], "src": [72,72], "f": 0, "t": 117, "d": [163,185] },
{ "px": [88,56], "src": [72,72], "f": 0, "t": 117, "d": [163,186] },
{ "px": [96,56], "src": [72,72], "f": 0, "t": 117, "d": [163,187] },
{ "px": [104,56], "src": [72,72], "f": 0, "t": 117, "d": [163,188] },
{ "px": [112,56], "src": [72,72], "f": 0, "t": 117, "d": [163,189] },
{ "px": [120,56], "src": [72,72], "f": 0, "t": 117, "d": [163,190] },
{ "px": [128,56], "src": [72,72], "f": 0, "t": 117, "d": [163,191] },
{ "px": [136,56], "src": [72,72], "f": 0, "t": 117, "d": [163,192] },
{ "px": [48,64], "src": [72,72], "f": 0, "t": 117, "d": [163,206] },
{ "px": [56,64], "src": [72,72], "f": 0, "t": 117, "d": [163,207] },
{ "px": [64,64], "src": [72,72], "f": 0, "t": 117, "d": [163,208] },
{ "px": [72,64], "src": [72,72], "f": 0, "t": 117, "d": [163,209] },
{ "px": [80,64], "src": [72,72], "f": 0, "t": 117, "d": [163,210] },
{ "px": [88,64], "src": [72,72], "f": 0, "t": 117, "d": [163,211] },
{ "px": [96,64], "src": [72,72], "f": 0, "t": 117, "d": [163,212] },
{ "px": [104,64], "src": [72,72], "f": 0, "t": 117, "d": [163,213] },
{ "px": [112,64], "src": [72,72], "f": 0, "t": 117, "d": [163,214] },
{ "px": [120,64], "src": [72,72], "f": 0, "t": 117, "d": [163,215] },
{ "px": [128,64], "src": [72,72], "f": 0, "t": 117, "d": [163,216] },
{ "px": [136,64], "src": [72,72], "f": 0, "t": 117, "d": [163,217] },
{ "px": [40,32], "src": [64,64], "f": 0, "t": 104, "d": [161,105] },
{ "px": [144,32], "src": [64,64], "f": 1, "t": 104, "d": [161,118] },
{ "px": [48,32], "src": [72,64], "f": 0, "t": 105, "d": [162,106] },
{ "px": [56,32], "src": [72,64], "f": 0, "t": 105, "d": [162,107] },
{ "px": [64,32], "src": [72,64], "f": 0, "t": 105, "d": [162,108] },
{ "px": [72,32], "src": [72,64], "f": 0, "t": 105, "d": [162,109] },
{ "px": [80,32], "src": [72,64], "f": 0, "t": 105, "d": [162,110] },
{ "px": [88,32], "src": [72,64], "f": 0, "t": 105, "d": [162,111] },
{ "px": [96,32], "src": [72,64], "f": 0, "t": 105, "d": [162,112] },
{ "px": [104,32], "src": [72,64], "f": 0, "t": 105, "d": [162,113] },
{ "px": [112,32], "src": [72,64], "f": 0, "t": 105, "d": [162,114] },
{ "px": [120,32], "src": [72,64], "f": 0, "t": 105, "d": [162,115] },
{ "px": [128,32], "src": [72,64], "f": 0, "t": 105, "d": [162,116] },
{ "px": [136,32], "src": [72,64], "f": 0, "t": 105, "d": [162,117] },
{ "px": [40,72], "src": [64,80], "f": 0, "t": 128, "d": [164,230] },
{ "px": [144,72], "src": [64,80], "f": 1, "t": 128, "d": [164,243] },
{ "px": [48,72], "src": [72,80], "f": 0, "t": 129, "d": [166,231] },
{ "px": [56,72], "src": [72,80], "f": 0, "t": 129, "d": [166,232] },
{ "px": [64,72], "src": [72,80], "f": 0, "t": 129, "d": [166,233] },
{ "px": [72,72], "src": [72,80], "f": 0, "t": 129, "d": [166,234] },
{ "px": [80,72], "src": [72,80], "f": 0, "t": 129, "d": [166,235] },
{ "px": [88,72], "src": [72,80], "f": 0, "t": 129, "d": [166,236] },
{ "px": [96,72], "src": [72,80], "f": 0, "t": 129, "d": [166,237] },
{ "px": [104,72], "src": [72,80], "f": 0, "t": 129, "d": [166,238] },
{ "px": [112,72], "src": [72,80], "f": 0, "t": 129, "d": [166,239] },
{ "px": [120,72], "src": [72,80], "f": 0, "t": 129, "d": [166,240] },
{ "px": [128,72], "src": [72,80], "f": 0, "t": 129, "d": [166,241] },
{ "px": [136,72], "src": [72,80], "f": 0, "t": 129, "d": [166,242] },
{ "px": [40,40], "src": [64,72], "f": 0, "t": 116, "d": [167,130] },
{ "px": [144,40], "src": [64,72], "f": 1, "t": 116, "d": [167,143] },
{ "px": [40,48], "src": [64,72], "f": 0, "t": 116, "d": [167,155] },
{ "px": [144,48], "src": [64,72], "f": 1, "t": 116, "d": [167,168] },
{ "px": [40,56], "src": [64,72], "f": 0, "t": 116, "d": [167,180] },
{ "px": [144,56], "src": [64,72], "f": 1, "t": 116, "d": [167,193] },
{ "px": [40,64], "src": [64,72], "f": 0, "t": 116, "d": [167,205] },
{ "px": [144,64], "src": [64,72], "f": 1, "t": 116, "d": [167,218] },
{ "px": [64,8], "src": [0,144], "f": 0, "t": 216, "d": [170,33] },
{ "px": [128,8], "src": [24,144], "f": 0, "t": 219, "d": [170,41] },
{ "px": [16,16], "src": [24,144], "f": 0, "t": 219, "d": [170,52] },
{ "px": [160,24], "src": [8,144], "f": 0, "t": 217, "d": [170,95] },
{ "px": [24,56], "src": [24,144], "f": 0, "t": 219, "d": [170,178] },
{ "px": [176,56], "src": [8,144], "f": 0, "t": 217, "d": [170,197] },
{ "px": [16,72], "src": [8,144], "f": 0, "t": 217, "d": [170,227] },
{ "px": [152,80], "src": [24,144], "f": 0, "t": 219, "d": [170,269] },
{ "px": [48,88], "src": [0,144], "f": 0, "t": 216, "d": [170,281] },
{ "px": [96,96], "src": [16,144], "f": 0, "t": 218, "d": [170,312] },
{ "px": [152,96], "src": [16,144], "f": 0, "t": 218, "d": [170,319] }
],
"seed": 7859030,
"overrideTilesetUid": null,
"gridTiles": [],
"entityInstances": []
},
{
"__identifier": "Trees",
"__type": "Tiles",
"__cWid": 25,
"__cHei": 15,
"__gridSize": 8,
"__opacity": 1,
"__pxTotalOffsetX": 0,
"__pxTotalOffsetY": 0,
"__tilesetDefUid": 151,
"__tilesetRelPath": "atlas/treesssss.png",
"levelId": 171,
"layerDefUid": 155,
"pxOffsetX": 0,
"pxOffsetY": 0,
"visible": true,
"optionalRules": [],
"intGridCsv": [],
"autoLayerTiles": [],
"seed": 2685528,
"overrideTilesetUid": null,
"gridTiles": [],
"entityInstances": []
},
{
"__identifier": "Entities",
"__type": "Entities",
"__cWid": 25,
"__cHei": 15,
"__gridSize": 8,
"__opacity": 1,
"__pxTotalOffsetX": 0,
"__pxTotalOffsetY": 0,
"__tilesetDefUid": null,
"__tilesetRelPath": null,
"levelId": 171,
"layerDefUid": 109,
"pxOffsetX": 0,
"pxOffsetY": 0,
"visible": true,
"optionalRules": [],
"intGridCsv": [],
"autoLayerTiles": [],
"seed": 9840960,
"overrideTilesetUid": null,
"gridTiles": [],
"entityInstances": []
},
{
"__identifier": "Patches",
"__type": "IntGrid",
"__cWid": 25,
"__cHei": 15,
"__gridSize": 8,
"__opacity": 1,
"__pxTotalOffsetX": 0,
"__pxTotalOffsetY": 0,
"__tilesetDefUid": 9,
"__tilesetRelPath": "atlas/Cavernas_by_Adam_Saltsman.png",
"levelId": 171,
"layerDefUid": 110,
"pxOffsetX": 0,
"pxOffsetY": 0,
"visible": true,
"optionalRules": [],
"intGridCsv": [
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
],
"autoLayerTiles": [],
"seed": 6102311,
"overrideTilesetUid": null,
"gridTiles": [],
"entityInstances": []
},
{
"__identifier": "Level",
"__type": "IntGrid",
"__cWid": 25,
"__cHei": 15,
"__gridSize": 8,
"__opacity": 1,
"__pxTotalOffsetX": 0,
"__pxTotalOffsetY": 0,
"__tilesetDefUid": 9,
"__tilesetRelPath": "atlas/Cavernas_by_Adam_Saltsman.png",
"levelId": 171,
"layerDefUid": 72,
"pxOffsetX": 0,
"pxOffsetY": 0,
"visible": true,
"optionalRules": [],
"intGridCsv": [
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
],
"autoLayerTiles": [],
"seed": 5803638,
"overrideTilesetUid": null,
"gridTiles": [],
"entityInstances": []
},
{
"__identifier": "Background",
"__type": "IntGrid",
"__cWid": 25,
"__cHei": 15,
"__gridSize": 8,
"__opacity": 1,
"__pxTotalOffsetX": 0,
"__pxTotalOffsetY": 0,
"__tilesetDefUid": 9,
"__tilesetRelPath": "atlas/Cavernas_by_Adam_Saltsman.png",
"levelId": 171,
"layerDefUid": 133,
"pxOffsetX": 0,
"pxOffsetY": 0,
"visible": true,
"optionalRules": [],
"intGridCsv": [
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
],
"autoLayerTiles": [],
"seed": 4002794,
"overrideTilesetUid": null,
"gridTiles": [],
"entityInstances": []
}
],
"__neighbours": []
}
]
}
\ No newline at end of file
Game({
transparent: '#171c39',
background: '#171c39',
file: '1.ldtk',
objects: {
Zone,
Player,
Key,
NPC
},
loaded: function() {
},
step: function(dt, tfs) {
physic(Levels["Game"], dt, tfs)
},
draw: function(dt, tfs) {
clear();
//if(Math.floor(tfs%2>1)){
render( Levels[ "Game" ] );
//}else{
// render( Levels[ "Dialog" ] );
//}
}
});
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
"use strict";const debug=0,showWatermark=0,godMode=0,debugOverlay=0,debugPhysics=0,debugParticles=0,debugRaycast=0,debugGamepads=0,debugMedals=0,ASSERT=()=>{},debugInit=()=>{},debugUpdate=()=>{},debugRender=()=>{},debugRect=()=>{},debugCircle=()=>{},debugPoint=()=>{},debugLine=()=>{},debugAABB=()=>{},debugText=()=>{},debugClear=()=>{},debugSaveCanvas=()=>{};"use strict";const PI=Math.PI,abs=a=>0>a?-a:a,min=(a,b)=>a<b?a:b,max=(a,b)=>a>b?a:b,sign=a=>0>a?-1:1,mod=(a,b=1)=>(a%b+b)%b,clamp=(a,b=0,c=1)=>a<b?b:a>c?c:a,percent=(a,b=0,c=1)=>c-b?clamp((a-b)/(c-b)):0,lerp=(a,b=0,c=1)=>b+clamp(a)*(c-b),smoothStep=a=>a*a*(3-2*a),nearestPowerOfTwo=a=>2**Math.ceil(Math.log2(a)),isOverlapping=(a,b,c,d)=>2*abs(a.x-c.x)<b.x+d.x&2*abs(a.y-c.y)<b.y+d.y,wave=(a=1,b=1,c=time)=>b/2*(1-Math.cos(c*a*2*PI)),formatTime=a=>(a/60|0)+":"+(10>a%60?"0":"")+(a%60|0),rand=(a=1,b=0)=>b+(a-b)*Math.random(),randInt=(a=1,b=0)=>rand(a,b)|0,randSign=()=>2*(rand(2)|0)-1,randInCircle=(a=1,b=0)=>0<a?randVector(a*rand(b/a,1)**.5):new Vector2,randVector=(a=1)=>(new Vector2).setAngle(rand(2*PI),a),randColor=(a=new Color,b=new Color(0,0,0,1),c)=>c?a.lerp(b,rand()):new Color(rand(a.r,b.r),rand(a.g,b.g),rand(a.b,b.b),rand(a.a,b.a));let randSeed=1;const randSeeded=(a=1,b=0)=>{randSeed^=randSeed<<13;randSeed^=randSeed>>>17;randSeed^=randSeed<<5;return b+(a-b)*abs(randSeed%1e9)/1e9},vec2=(a=0,b)=>void 0==a.x?new Vector2(a,void 0==b?a:b):new Vector2(a.x,a.y);class Vector2{constructor(a=0,b=0){this.x=a;this.y=b}copy(){return new Vector2(this.x,this.y)}add(a){ASSERT(void 0!=a.x);return new Vector2(this.x+a.x,this.y+a.y)}subtract(a){ASSERT(void 0!=a.x);return new Vector2(this.x-a.x,this.y-a.y)}multiply(a){ASSERT(void 0!=a.x);return new Vector2(this.x*a.x,this.y*a.y)}divide(a){ASSERT(void 0!=a.x);return new Vector2(this.x/a.x,this.y/a.y)}scale(a){ASSERT(void 0==a.x);return new Vector2(this.x*a,this.y*a)}length(){return this.lengthSquared()**.5}lengthSquared(){return this.x**2+this.y**2}distance(a){return this.distanceSquared(a)**.5}distanceSquared(a){return(this.x-a.x)**2+(this.y-a.y)**2}normalize(a=1){const b=this.length();return b?this.scale(a/b):new Vector2(a)}clampLength(a=1){const b=this.length();return b>a?this.scale(a/b):this}dot(a){ASSERT(void 0!=a.x);return this.x*a.x+this.y*a.y}cross(a){ASSERT(void 0!=a.x);return this.x*a.y-this.y*a.x}angle(){return Math.atan2(this.x,this.y)}setAngle(a=0,b=1){this.x=b*Math.sin(a);this.y=b*Math.cos(a);return this}rotate(a){const b=Math.cos(a);a=Math.sin(a);return new Vector2(this.x*b-this.y*a,this.x*a+this.y*b)}direction(){return abs(this.x)>abs(this.y)?0>this.x?3:1:0>this.y?2:0}invert(){return new Vector2(this.y,-this.x)}floor(){return new Vector2(Math.floor(this.x),Math.floor(this.y))}area(){return this.x*this.y}lerp(a,b){ASSERT(void 0!=a.x);return this.add(a.subtract(this).scale(clamp(b)))}arrayCheck(a){return 0<=this.x&&0<=this.y&&this.x<a.x&&this.y<a.y}}class Color{constructor(a=1,b=1,c=1,d=1){this.r=a;this.g=b;this.b=c;this.a=d}copy(){return new Color(this.r,this.g,this.b,this.a)}add(a){return new Color(this.r+a.r,this.g+a.g,this.b+a.b,this.a+a.a)}subtract(a){return new Color(this.r-a.r,this.g-a.g,this.b-a.b,this.a-a.a)}multiply(a){return new Color(this.r*a.r,this.g*a.g,this.b*a.b,this.a*a.a)}divide(a){return new Color(this.r/a.r,this.g/a.g,this.b/a.b,this.a/a.a)}scale(a,b=a){return new Color(this.r*a,this.g*a,this.b*a,this.a*b)}clamp(){return new Color(clamp(this.r),clamp(this.g),clamp(this.b),clamp(this.a))}lerp(a,b){return this.add(a.subtract(this).scale(clamp(b)))}setHSLA(a=0,b=0,c=1,d=1){b=.5>c?c*(1+b):c+b-c*b;c=2*c-b;const e=(f,h,k)=>(k=(k%1+1)%1)<1/6?f+6*(h-f)*k:.5>k?h:k<2/3?f+(h-f)*(2/3-k)*6:f;this.r=e(c,b,a+1/3);this.g=e(c,b,a);this.b=e(c,b,a-1/3);this.a=d;return this}mutate(a=.05,b=0){return new Color(this.r+rand(a,-a),this.g+rand(a,-a),this.b+rand(a,-a),this.a+rand(b,-b)).clamp()}rgba(){ASSERT(0<=this.r&&1>=this.r&&0<=this.g&&1>=this.g&&0<=this.b&&1>=this.b&&0<=this.a&&1>=this.a);return`rgb(${255*this.r|0},${255*this.g|0},${255*this.b|0},${this.a})`}rgbaInt(){ASSERT(0<=this.r&&1>=this.r&&0<=this.g&&1>=this.g&&0<=this.b&&1>=this.b&&0<=this.a&&1>=this.a);return(255*this.r|0)+(255*this.g<<8)+(255*this.b<<16)+(255*this.a<<24)}}class Timer{constructor(a){this.time=void 0==a?void 0:time+a;this.setTime=a}set(a=0){this.time=time+a;this.setTime=a}unset(){this.time=void 0}isSet(){return void 0!=this.time}active(){return time<=this.time}elapsed(){return time>this.time}get(){return this.isSet()?time-this.time:0}getPercent(){return this.isSet()?percent(this.time-time,this.setTime,0):0}}"use strict";let canvasMaxSize=vec2(1920,1200),canvasFixedSize=vec2(),cavasPixelated=1,fontDefault="arial",tileSizeDefault=vec2(16),tileFixBleedScale=.3,objectDefaultSize=vec2(1),objectDefaultMass=1,objectDefaultDamping=.99,objectDefaultAngleDamping=.99,objectDefaultElasticity=0,objectDefaultFriction=.8,objectMaxSpeed=1,gravity=0,particleEmitRateScale=1,cameraPos=vec2(),cameraScale=max(tileSizeDefault.x,tileSizeDefault.y),glEnable=1,glOverlay=1,gamepadsEnable=1,gamepadDirectionEmulateStick=1,inputWASDEmulateDirection=1,touchGamepadEnable=0,touchGamepadSize=80,touchGamepadAlpha=.3,vibrateEnable=1,soundVolume=.5,soundEnable=1,soundDefaultRange=30,soundDefaultTaper=.7,medalDisplayTime=5,medalDisplaySlideTime=.5,medalDisplayWidth=640,medalDisplayHeight=80,medalDisplayIconSize=50;"use strict";const engineName="LittleJS",engineVersion="1.1.5",frameRate=60,timeDelta=1/frameRate;let engineObjects=[],engineObjectsCollide=[],frame=0,time=0,timeReal=0,paused=0,frameTimeLastMS=0,frameTimeBufferMS=0,tileImageSize,tileImageFixBleed,averageFPS,drawCount;const styleBody="margin:0;overflow:hidden;background:#000;touch-action:none;user-select:none;-webkit-user-select:none;-moz-user-select:none",styleCanvas="position:absolute";function engineInit(a,b,c,d,e,f){tileImage.onerror=tileImage.onload=()=>{tileImageFixBleed=vec2(tileFixBleedScale).divide(tileImageSize=vec2(tileImage.width,tileImage.height));debug&&(tileImage.onload=()=>ASSERT(1));document.body.style=styleBody;document.body.appendChild(mainCanvas=document.createElement("canvas"));mainContext=mainCanvas.getContext("2d");mainCanvas.style=styleCanvas;debugInit();glInit();document.body.appendChild(overlayCanvas=document.createElement("canvas"));overlayContext=overlayCanvas.getContext("2d");overlayCanvas.style=styleCanvas;a();touchGamepadCreate();h()};const h=(k=0)=>{requestAnimationFrame(h);var l=k-frameTimeLastMS;frameTimeLastMS=k;if(debug||showWatermark)averageFPS=lerp(.05,averageFPS||0,1e3/(l||1));debug&&(l*=keyIsDown(107)?5:keyIsDown(109)?.2:1);timeReal+=l/1e3;frameTimeBufferMS=min(frameTimeBufferMS+!paused*l,50);if(paused)inputUpdate(),debugUpdate(),c(),inputUpdatePost();else{k=0;0>frameTimeBufferMS&&-9<frameTimeBufferMS&&(k=frameTimeBufferMS,frameTimeBufferMS=0);for(;0<=frameTimeBufferMS;frameTimeBufferMS-=1e3/frameRate)inputUpdate(),b(),engineObjectsUpdate(),debugUpdate(),c(),inputUpdatePost();frameTimeBufferMS+=k}canvasFixedSize.x?(mainCanvas.width=canvasFixedSize.x,mainCanvas.height=canvasFixedSize.y,k=innerWidth/innerHeight,l=canvasFixedSize.x/canvasFixedSize.y,mainCanvas.style.width=overlayCanvas.style.width=mainCanvas.style.height=overlayCanvas.style.height=mainCanvas.style.top=overlayCanvas.style.top=mainCanvas.style.left=overlayCanvas.style.left="",k<l?(mainCanvas.style.width=overlayCanvas.style.width=innerWidth,mainCanvas.style.top=overlayCanvas.style.top=(innerHeight-innerWidth/l)/2):(mainCanvas.style.height=overlayCanvas.style.height=innerHeight,mainCanvas.style.left=overlayCanvas.style.left=(innerWidth-innerHeight*l)/2)):(mainCanvas.width=min(innerWidth,canvasMaxSize.x),mainCanvas.height=min(innerHeight,canvasMaxSize.y),overlayCanvas.style.top=mainCanvas.style.top=(innerHeight-mainCanvas.height)/2,overlayCanvas.style.left=mainCanvas.style.left=(innerWidth-mainCanvas.width)/2);glEnable&&(glCanvas.style.width=mainCanvas.style.width,glCanvas.style.height=mainCanvas.style.height,glCanvas.style.top=mainCanvas.style.top,glCanvas.style.left=mainCanvas.style.left);enginePreRender();d();engineObjects.sort((m,g)=>m.renderOrder-g.renderOrder);for(var n of engineObjects)n.destroyed||n.render();e();medalsRender();touchGamepadRender();debugRender();glCopyToContext(mainContext);showWatermark&&(overlayContext.textAlign="right",overlayContext.textBaseline="top",overlayContext.font="1em monospace",overlayContext.fillStyle="#000",n=engineName+" v"+engineVersion+" / "+drawCount+" / "+engineObjects.length+" / "+averageFPS.toFixed(1)+" "+(glEnable?"GL":"2D"),overlayContext.fillText(n,mainCanvas.width-3,3),overlayContext.fillStyle="#fff",overlayContext.fillText(n,mainCanvas.width-2,2),drawCount=0)};f?tileImage.src=f:tileImage.onload()}function enginePreRender(){mainCanvasSize=vec2(overlayCanvas.width=mainCanvas.width,overlayCanvas.height=mainCanvas.height);mainContext.imageSmoothingEnabled=!cavasPixelated;glPreRender(mainCanvas.width,mainCanvas.height,cameraPos.x,cameraPos.y,cameraScale)}function engineObjectsUpdate(){engineObjectsCollide=engineObjects.filter(b=>b.collideSolidObjects);const a=b=>{if(!b.destroyed){b.update();for(const c of b.children)a(c)}};for(const b of engineObjects)b.parent||a(b);engineObjects=engineObjects.filter(b=>!b.destroyed);time=++frame/frameRate}function engineObjectsDestroy(){for(const a of engineObjects)a.parent||a.destroy();engineObjects=engineObjects.filter(a=>!a.destroyed)}function engineObjectsCallback(a,b,c,d=engineObjects){if(a)if(void 0!=b.x)for(const e of d)isOverlapping(a,b,e.pos,e.size)&&c(e);else{b*=b;for(const e of d)a.distanceSquared(e.pos)<b&&c(e)}else for(const e of d)c(e)}"use strict";class EngineObject{constructor(a=vec2(),b=objectDefaultSize,c=-1,d=tileSizeDefault,e=0,f,h=0){ASSERT(a&&void 0!=a.x&&void 0!=b.x);this.pos=a.copy();this.size=b;this.drawSize;this.tileIndex=c;this.tileSize=d;this.angle=e;this.color=f;this.additiveColor;this.mass=objectDefaultMass;this.damping=objectDefaultDamping;this.angleDamping=objectDefaultAngleDamping;this.elasticity=objectDefaultElasticity;this.friction=objectDefaultFriction;this.gravityScale=1;this.renderOrder=h;this.velocity=new Vector2;this.angleVelocity=0;this.spawnTime=time;this.children=[];this.collideTiles=1;engineObjects.push(this)}update(){var a=this.parent;if(a)this.pos=this.localPos.multiply(vec2(a.getMirrorSign(),1)).rotate(-a.angle).add(a.pos),this.angle=a.getMirrorSign()*this.localAngle+a.angle;else if(this.velocity.x=clamp(this.velocity.x,-objectMaxSpeed,objectMaxSpeed),this.velocity.y=clamp(this.velocity.y,-objectMaxSpeed,objectMaxSpeed),a=this.pos.copy(),this.pos.x+=this.velocity.x*=this.damping,this.pos.y+=this.velocity.y=this.damping*this.velocity.y+gravity*this.gravityScale,this.angle+=this.angleVelocity*=this.angleDamping,ASSERT(0<=this.angleDamping&&1>=this.angleDamping),ASSERT(0<=this.damping&&1>=this.damping),this.mass){var b=0>this.velocity.y;if(this.groundObject){var c=this.groundObject.velocity?this.groundObject.velocity.x:0;this.velocity.x=c+(this.velocity.x-c)*this.friction;this.groundObject=0}if(this.collideSolidObjects)for(var d of engineObjectsCollide)if(!(!this.isSolid&!d.isSolid||d.destroyed||d.parent||d==this||!isOverlapping(this.pos,this.size,d.pos,d.size)||!this.collideWithObject(d)|!d.collideWithObject(this)))if(isOverlapping(a,this.size,d.pos,d.size)){c=a.subtract(d.pos);var e=c.length();c=.01>e?randVector(.001):c.scale(.001/e);this.velocity=this.velocity.add(c);d.mass&&(d.velocity=d.velocity.subtract(c));debugPhysics&&debugAABB(this.pos,this.size,d.pos,d.size,"#f00")}else{c=this.size.add(d.size);e=2*(a.y-d.pos.y)>c.y+gravity;var f=2*abs(a.y-d.pos.y)<c.y,h=2*abs(a.x-d.pos.x)<c.x;if(e||h||!f)if(this.pos.y=d.pos.y+(c.y/2+.001)*sign(a.y-d.pos.y),d.groundObject&&b||!d.mass)b&&(this.groundObject=d),this.velocity.y*=-this.elasticity;else if(d.mass){const k=(this.mass*this.velocity.y+d.mass*d.velocity.y)/(this.mass+d.mass),l=this.velocity.y*(this.mass-d.mass)/(this.mass+d.mass)+2*d.velocity.y*d.mass/(this.mass+d.mass),n=d.velocity.y*(d.mass-this.mass)/(this.mass+d.mass)+2*this.velocity.y*this.mass/(this.mass+d.mass),m=max(this.elasticity,d.elasticity);this.velocity.y=lerp(m,k,l);d.velocity.y=lerp(m,k,n)}e||!f&&h||(this.pos.x=d.pos.x+(c.x/2+.001)*sign(a.x-d.pos.x),d.mass?(c=(this.mass*this.velocity.x+d.mass*d.velocity.x)/(this.mass+d.mass),e=this.velocity.x*(this.mass-d.mass)/(this.mass+d.mass)+2*d.velocity.x*d.mass/(this.mass+d.mass),f=d.velocity.x*(d.mass-this.mass)/(this.mass+d.mass)+2*this.velocity.x*this.mass/(this.mass+d.mass),h=max(this.elasticity,d.elasticity),this.velocity.x=lerp(h,c,e),d.velocity.x=lerp(h,c,f)):this.velocity.x*=-this.elasticity);debugPhysics&&debugAABB(this.pos,this.size,d.pos,d.size,"#f0f")}if(this.collideTiles&&tileCollisionTest(this.pos,this.size,this)&&!tileCollisionTest(a,this.size,this)){c=tileCollisionTest(new Vector2(a.x,this.pos.y),this.size,this);d=tileCollisionTest(new Vector2(this.pos.x,a.y),this.size,this);if(c||!d)this.groundObject=b,this.velocity.y*=-this.elasticity,b=(a.y-this.size.y/2|0)-(a.y-this.size.y/2),0>b&&b>this.damping*this.velocity.y+gravity*this.gravityScale&&(this.velocity.y=this.damping?(b-gravity*this.gravityScale)/this.damping:0),this.pos.y=a.y;d&&(this.pos.x=a.x,this.velocity.x*=-this.elasticity)}}}render(){drawTile(this.pos,this.drawSize||this.size,this.tileIndex,this.tileSize,this.color,this.angle,this.mirror,this.additiveColor)}destroy(){if(!this.destroyed){this.destroyed=1;this.parent&&this.parent.removeChild(this);for(const a of this.children)a.destroy(a.parent=0)}}collideWithTile(a,b){return 0<a}collideWithTileRaycast(a,b){return 0<a}collideWithObject(a){return 1}getAliveTime(){return time-this.spawnTime}applyAcceleration(a){this.mass&&(this.velocity=this.velocity.add(a))}applyForce(a){this.applyAcceleration(a.scale(1/this.mass))}getMirrorSign(){return this.mirror?-1:1}addChild(a,b=vec2(),c=0){ASSERT(!a.parent&&!this.children.includes(a));this.children.push(a);a.parent=this;a.localPos=b.copy();a.localAngle=c}removeChild(a){ASSERT(a.parent==this&&this.children.includes(a));this.children.splice(this.children.indexOf(a),1);a.parent=0}setCollision(a=0,b=0,c=1){ASSERT(a||!b);this.collideSolidObjects=a;this.isSolid=b;this.collideTiles=c}}"use strict";const tileImage=new Image;let mainCanvas,mainContext,overlayCanvas,overlayContext,mainCanvasSize=vec2();const screenToWorld=a=>a.add(vec2(.5)).subtract(mainCanvasSize.scale(.5)).multiply(vec2(1/cameraScale,-1/cameraScale)).add(cameraPos),worldToScreen=a=>a.subtract(cameraPos).multiply(vec2(cameraScale,-cameraScale)).add(mainCanvasSize.scale(.5)).subtract(vec2(.5));function drawTile(a,b=vec2(1),c=-1,d=tileSizeDefault,e=new Color,f=0,h,k=new Color(0,0,0,0),l=glEnable){showWatermark&&++drawCount;if(glEnable&&l)if(0>c||!tileImage.width)glDraw(a.x,a.y,b.x,b.y,f,0,0,0,0,0,e.rgbaInt());else{var n=tileImageSize.x/d.x|0;l=d.x/tileImageSize.x;const m=d.y/tileImageSize.y,g=c%n*l;n=(c/n|0)*m;glDraw(a.x,a.y,h?-b.x:b.x,b.y,f,g+tileImageFixBleed.x,n+tileImageFixBleed.y,g-tileImageFixBleed.x+l,n-tileImageFixBleed.y+m,e.rgbaInt(),k.rgbaInt())}else drawCanvas2D(a,b,f,h,m=>{if(0>c)m.fillStyle=e.rgba(),m.fillRect(-.5,-.5,1,1);else{var g=tileImageSize.x/d.x|0;const u=c%g*d.x+tileFixBleedScale;g=(c/g|0)*d.y+tileFixBleedScale;const w=d.x-2*tileFixBleedScale,v=d.y-2*tileFixBleedScale;m.globalAlpha=e.a;m.drawImage(tileImage,u,g,w,v,-.5,-.5,1,1)}})}function drawRect(a,b,c,d,e){drawTile(a,b,-1,tileSizeDefault,c,d,0,0,e)}function drawTileScreenSpace(a,b=vec2(1),c,d,e,f,h,k,l){drawTile(screenToWorld(a),b.scale(1/cameraScale),c,d,e,f,h,k,l)}function drawRectScreenSpace(a,b,c,d,e){drawTileSrceenSpace(a,b,-1,tileSizeDefault,c,d,0,0,e)}function drawLine(a,b,c=.1,d,e){b=vec2((b.x-a.x)/2,(b.y-a.y)/2);c=vec2(c,2*b.length());drawRect(a.add(b),c,d,b.angle(),0,0,e)}function drawCanvas2D(a,b,c,d,e,f=mainContext){a=worldToScreen(a);b=b.scale(cameraScale);f.save();f.translate(a.x+.5|0,a.y-.5|0);f.rotate(c);f.scale(d?-b.x:b.x,b.y);e(f);f.restore()}function drawText(a,b,c=1,d=new Color,e=0,f=new Color(0,0,0),h="center",k=fontDefault){b=worldToScreen(b);overlayContext.font=c*cameraScale+"px "+k;overlayContext.textAlign=h;overlayContext.textBaseline="middle";e&&(overlayContext.lineWidth=e*cameraScale,overlayContext.strokeStyle=f.rgba(),overlayContext.strokeText(a,b.x,b.y));overlayContext.fillStyle=d.rgba();overlayContext.fillText(a,b.x,b.y)}function setBlendMode(a,b=glEnable){glEnable&&b?glSetBlendMode(a):mainContext.globalCompositeOperation=a?"lighter":"source-over"}const isFullscreen=()=>document.fullscreenElement;function toggleFullscreen(){isFullscreen()?document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen&&document.mozCancelFullScreen():document.body.webkitRequestFullScreen?document.body.webkitRequestFullScreen():document.body.mozRequestFullScreen&&document.body.mozRequestFullScreen()}"use strict";const keyIsDown=(a,b=0)=>inputData[b]&&inputData[b][a]&1?1:0,keyWasPressed=(a,b=0)=>inputData[b]&&inputData[b][a]&2?1:0,keyWasReleased=(a,b=0)=>inputData[b]&&inputData[b][a]&4?1:0,clearInput=()=>inputData=[[]],mouseIsDown=keyIsDown,mouseWasPressed=keyWasPressed,mouseWasReleased=keyWasReleased;let mousePos=vec2(),mousePosScreen=vec2(),mouseWheel=0,isUsingGamepad=0;const gamepadIsDown=(a,b=0)=>keyIsDown(a,b+1),gamepadWasPressed=(a,b=0)=>keyWasPressed(a,b+1),gamepadWasReleased=(a,b=0)=>keyWasReleased(a,b+1),gamepadStick=(a,b=0)=>stickData[b]?stickData[b][a]||vec2():vec2();let inputData=[[]];function inputUpdate(){document.hasFocus()||clearInput();mousePos=screenToWorld(mousePosScreen);gamepadsUpdate()}function inputUpdatePost(){for(const a of inputData)for(const b in a)a[b]&=1;mouseWheel=0}onkeydown=a=>{debug&&a.target!=document.body||(a.repeat||(inputData[isUsingGamepad=0][remapKeyCode(a.keyCode)]=3),debug||a.preventDefault())};onkeyup=a=>{debug&&a.target!=document.body||(inputData[0][remapKeyCode(a.keyCode)]=4)};const remapKeyCode=a=>inputWASDEmulateDirection?87==a?38:83==a?40:65==a?37:68==a?39:a:a;onmousedown=a=>{inputData[isUsingGamepad=0][a.button]=3;onmousemove(a);a.button&&a.preventDefault()};onmouseup=a=>inputData[0][a.button]=inputData[0][a.button]&2|4;onmousemove=a=>mousePosScreen=mouseToScreen(a);onwheel=a=>a.ctrlKey||(mouseWheel=sign(a.deltaY));oncontextmenu=a=>!1;const mouseToScreen=a=>{if(!mainCanvas)return vec2();const b=mainCanvas.getBoundingClientRect();return mainCanvasSize.multiply(vec2(percent(a.x,b.left,b.right),percent(a.y,b.top,b.bottom)))},stickData=[];function gamepadsUpdate(){if(touchGamepadEnable&&touchGamepadTimer.isSet()){(stickData[0]||(stickData[0]=[]))[0]=vec2(touchGamepadStick.x,-touchGamepadStick.y);var a=inputData[1]||(inputData[1]=[]);for(var b=10;b--;){var c=3==b?2:2==b?3:b;a[c]=touchGamepadButtons[b]?1+2*!gamepadIsDown(c,0):4*gamepadIsDown(c,0)}}if(gamepadsEnable&&navigator.getGamepads&&(document.hasFocus()||debug))for(a=navigator.getGamepads(),b=a.length;b--;){var d=a[b];const h=inputData[b+1]||(inputData[b+1]=[]);c=stickData[b]||(stickData[b]=[]);if(d){var e=k=>.3<k?percent(k,.3,.8):-.3>k?-percent(-k,.3,.8):0;for(var f=0;f<d.axes.length-1;f+=2)c[f>>1]=vec2(e(d.axes[f]),e(-d.axes[f+1])).clampLength();for(e=d.buttons.length;e--;)f=d.buttons[e],h[e]=f.pressed?1+2*!gamepadIsDown(e,b):4*gamepadIsDown(e,b),isUsingGamepad|=!b&&f.pressed,touchGamepadEnable&&touchGamepadTimer.unset();gamepadDirectionEmulateStick&&(d=vec2(gamepadIsDown(15,b)-gamepadIsDown(14,b),gamepadIsDown(12,b)-gamepadIsDown(13,b)),d.lengthSquared()&&(c[0]=d.clampLength()))}}}const vibrate=a=>vibrateEnable&&Navigator.vibrate&&Navigator.vibrate(a),vibrateStop=()=>vibrate(0),isTouchDevice=void 0!==window.ontouchstart;if(isTouchDevice){let a,b;ontouchstart=ontouchmove=ontouchend=c=>{c.button=0;const d=c.touches.length;d?(b||zzfx(0,b=1),c.x=c.touches[0].clientX,c.y=c.touches[0].clientY,a?onmousemove(c):onmousedown(c)):a&&onmouseup(c);a=d;return!c.cancelable}}let touchGamepadTimer=new Timer,touchGamepadButtons=[],touchGamepadStick=vec2(),touchGamepadAnalog=1;function touchGamepadCreate(){touchGamepadEnable&&isTouchDevice&&(ontouchstart=ontouchmove=ontouchend=a=>{if(touchGamepadEnable){touchGamepadStick=vec2();touchGamepadButtons=[];if(a.touches.length&&(touchGamepadTimer.isSet()||zzfx(0),isUsingGamepad=1,touchGamepadTimer.set(),paused)){touchGamepadButtons[9]=1;return}var b=vec2(touchGamepadSize,mainCanvasSize.y-touchGamepadSize),c=mainCanvasSize.subtract(vec2(touchGamepadSize,touchGamepadSize)),d=mainCanvasSize.scale(.5);for(const e of a.touches)a=mouseToScreen(vec2(e.clientX,e.clientY)),a.distance(b)<touchGamepadSize?touchGamepadAnalog?touchGamepadStick=a.subtract(b).clampLength(touchGamepadSize/2).scale(2/touchGamepadSize):(a=a.subtract(b).angle(),touchGamepadStick.setAngle((4*a/PI+8.5|0)*PI/4)):a.distance(c)<touchGamepadSize?(a=a.subtract(c).direction(),touchGamepadButtons[a]=1):a.distance(d)<touchGamepadSize&&(touchGamepadButtons[9]=1)}})}function touchGamepadRender(){if(touchGamepadEnable&&touchGamepadTimer.isSet()){var a=percent(touchGamepadTimer.get(),4,3);if(a&&!paused){overlayContext.save();overlayContext.globalAlpha=a*touchGamepadAlpha;overlayContext.strokeStyle="#fff";overlayContext.lineWidth=3;overlayContext.fillStyle=0<gamepadStick(0).length()?"#fff":"#000";overlayContext.beginPath();overlayContext.arc(touchGamepadSize,mainCanvasSize.y-touchGamepadSize,touchGamepadSize/2,0,9);overlayContext.fill();overlayContext.stroke();a=vec2(mainCanvasSize.x-touchGamepadSize,mainCanvasSize.y-touchGamepadSize);for(let b=4;b--;){const c=a.add((new Vector2).setAngle(b*PI/2,touchGamepadSize/2));overlayContext.fillStyle=touchGamepadButtons[b]?"#fff":"#000";overlayContext.beginPath();overlayContext.arc(c.x,c.y,touchGamepadSize/4,0,9);overlayContext.fill();overlayContext.stroke()}overlayContext.restore()}}}"use strict";class Sound{constructor(a,b=soundDefaultRange,c=soundDefaultTaper){soundEnable&&(this.range=b,this.taper=c,this.randomness=a[1]||0,a[1]=0,this.cachedSamples=zzfxG(...a))}play(a,b=1,c=1,d=1){if(soundEnable){var e=0;if(a){if(e=this.range){const f=cameraPos.distanceSquared(a);if(f>e*e)return;b*=percent(f**.5,e,e*this.taper)}e=2*worldToScreen(a).x/mainCanvas.width-1}a=c+c*this.randomness*d*rand(-1,1);return playSamples([this.cachedSamples],b,a,e)}}playNote(a,b,c=1){if(soundEnable)return this.play(b,c,2**(a/12),0)}}class Music{constructor(a){soundEnable&&(this.cachedSamples=zzfxM(...a))}play(a=1,b=1){if(soundEnable)return playSamples(this.cachedSamples,a,1,0,b)}}function playAudioFile(a,b=1,c=1){if(soundEnable)return a=new Audio(a),a.volume=soundVolume*b,a.loop=c,a.play(),a}function speak(a,b="",c=1,d=1,e=1){if(soundEnable&&speechSynthesis)return a=new SpeechSynthesisUtterance(a),a.lang=b,a.volume=2*c*soundVolume,a.rate=d,a.pitch=e,speechSynthesis.speak(a),a}const speakStop=()=>speechSynthesis&&speechSynthesis.cancel(),getNoteFrequency=(a,b=220)=>b*2**(a/12);let audioContext;function playSamples(a,b=1,c=1,d=0,e=0){if(soundEnable&&(audioContext||(audioContext=new(window.AudioContext||webkitAudioContext)),audioContext.resume(),"running"==audioContext.state)){var f=audioContext.createBuffer(a.length,a[0].length,zzfxR),h=audioContext.createBufferSource();a.forEach((k,l)=>f.getChannelData(l).set(k));h.buffer=f;h.playbackRate.value=c;h.loop=e;a=audioContext.createGain();a.gain.value=soundVolume*b;a.connect(audioContext.destination);(window.StereoPannerNode?h.connect(new StereoPannerNode(audioContext,{pan:clamp(d,-1,1)})):h).connect(a);h.start();return h}}const zzfx=(...a)=>playSamples([zzfxG(...a)]),zzfxR=44100;function zzfxG(a=1,b=.05,c=220,d=0,e=0,f=.1,h=0,k=1,l=0,n=0,m=0,g=0,u=0,w=0,v=0,A=0,q=0,B=1,x=0,C=0){let r=2*PI,E=l*=500*r/zzfxR/zzfxR,y=[];b=c*=(1+b*rand(-1,1))*r/zzfxR;let t=0,F=0,p=0,z=1,H=0,I=0,D=0,J,G;d=d*zzfxR+9;x*=zzfxR;e*=zzfxR;f*=zzfxR;q*=zzfxR;n*=500*r/zzfxR**3;v*=r/zzfxR;m*=r/zzfxR;g*=zzfxR;u=u*zzfxR|0;for(G=d+x+e+f+q|0;p<G;y[p++]=D)++I%(100*A|0)||(D=h?1<h?2<h?3<h?Math.sin((t%r)**3):Math.max(Math.min(Math.tan(t),1),-1):1-(2*t/r%2+2)%2:1-4*abs(Math.round(t/r)-t/r):Math.sin(t),D=(u?1-C+C*Math.sin(r*p/u):1)*(0<D?1:-1)*abs(D)**k*a*soundVolume*(p<d?p/d:p<d+x?1-(p-d)/x*(1-B):p<d+x+e?B:p<G-q?(G-p-q)/f*B:0),D=q?D/2+(q>p?0:(p<G-q?1:(G-p)/q)*y[p-q|0]/2):D),J=(c+=l+=n)*Math.cos(v*F++),t+=J-J*w*(1-1e9*(Math.sin(p)+1)%2),z&&++z>g&&(c+=m,b+=m,z=0),!u||++H%u||(c=b,l=E,z=z||1);return y}function zzfxM(a,b,c,d=125){let e,f,h,k,l,n,m,g,u,w,v,A,q,B=0,x,C=[],r=[],E=[],y=0,t=0,F=1,p={},z=zzfxR/d*60>>2;for(;F;y++)C=[F=g=A=0],c.forEach((H,I)=>{m=b[H][y]||[0,0,0];F|=!!b[H][y];x=A+(b[H][0].length-2-!g)*z;q=I==c.length-1;f=2;for(k=A;f<m.length+q;g=++f){l=m[f];u=f==m.length+q-1&&q||w!=(m[0]||0)|l|0;for(h=0;h<z&&g;h++>z-99&&u?v+=(1>v)/99:0)n=(1-v)*C[B++]/2||0,r[k]=(r[k]||0)-n*t+n,E[k]=(E[k++]||0)+n*t+n;l&&(v=l%1,t=m[1]||0,l|=0)&&(C=p[[w=m[B=0]||0,l]]=p[[w,l]]||(e=[...a[w]],e[2]*=2**((l-12)/12),0<l?zzfxG(...e):[]))}A=x});return[r,E]}"use strict";let tileCollision=[],tileCollisionSize=vec2();function initTileCollision(a){tileCollisionSize=a;tileCollision=[];for(a=tileCollision.length=tileCollisionSize.area();a--;)tileCollision[a]=0}const setTileCollisionData=(a,b=0)=>a.arrayCheck(tileCollisionSize)&&(tileCollision[(a.y|0)*tileCollisionSize.x+a.x|0]=b),getTileCollisionData=a=>a.arrayCheck(tileCollisionSize)?tileCollision[(a.y|0)*tileCollisionSize.x+a.x|0]:0;function tileCollisionTest(a,b=vec2(),c){const d=max(a.x-b.x/2|0,0);var e=max(a.y-b.y/2|0,0);const f=min(a.x+b.x/2,tileCollisionSize.x);for(a=min(a.y+b.y/2,tileCollisionSize.y);e<a;++e)for(b=d;b<f;++b){const h=tileCollision[e*tileCollisionSize.x+b];if(h&&(!c||c.collideWithTile(h,new Vector2(b,e))))return 1}}function tileCollisionRaycast(a,b,c){a=a.floor();b=b.floor();var d=b.subtract(a);const e=abs(d.x),f=-abs(d.y),h=sign(d.x);d=sign(d.y);let k=e+f;for(let n=a.x,m=a.y;;){var l=getTileCollisionData(vec2(n,m));if(l&&(c?c.collideWithTileRaycast(l,new Vector2(n,m)):0<l))return debugRaycast&&debugLine(a,b,"#f00",.02,1),debugRaycast&&debugPoint(new Vector2(n+.5,m+.5),"#ff0",1),new Vector2(n+.5,m+.5);if(n==b.x&m==b.y)break;l=2*k;l>=f&&(k+=f,n+=h);l<=e&&(k+=e,m+=d)}debugRaycast&&debugLine(a,b,"#00f",.02,1)}class TileLayerData{constructor(a,b=0,c=0,d=new Color){this.tile=a;this.direction=b;this.mirror=c;this.color=d}clear(){this.tile=this.direction=this.mirror=0;color=new Color}}class TileLayer extends EngineObject{constructor(a,b=tileCollisionSize,c=tileSizeDefault,d=vec2(1),e=0){super(a,b,-1,c,0,void 0,e);this.canvas=document.createElement("canvas");this.context=this.canvas.getContext("2d");this.scale=d;this.isOverlay;this.data=[];for(a=this.size.area();a--;)this.data.push(new TileLayerData)}setData(a,b,c){a.arrayCheck(this.size)&&(this.data[(a.y|0)*this.size.x+a.x|0]=b,c&&this.drawTileData(a))}getData(a){return a.arrayCheck(this.size)&&this.data[(a.y|0)*this.size.x+a.x|0]}update(){}render(){ASSERT(mainContext!=this.context);glEnable&&!glOverlay&&!this.isOverlay&&glCopyToContext(mainContext);const a=worldToScreen(this.pos.add(vec2(0,this.size.y*this.scale.y)));(this.isOverlay?overlayContext:mainContext).drawImage(this.canvas,a.x,a.y,cameraScale*this.size.x*this.scale.x,cameraScale*this.size.y*this.scale.y)}redraw(){this.redrawStart(1);this.drawAllTileData();this.redrawEnd()}redrawStart(a=0){a&&(this.canvas.width=this.size.x*this.tileSize.x,this.canvas.height=this.size.y*this.tileSize.y);this.savedRenderSettings=[mainCanvas,mainContext,cameraPos,cameraScale];mainCanvas=this.canvas;mainContext=this.context;cameraPos=this.size.scale(.5);cameraScale=this.tileSize.x;enginePreRender()}redrawEnd(){ASSERT(mainContext==this.context);glCopyToContext(mainContext,1);[mainCanvas,mainContext,cameraPos,cameraScale]=this.savedRenderSettings}drawTileData(a){const b=a.floor().add(this.pos).add(vec2(.5));this.drawCanvas2D(b,vec2(1),0,0,c=>c.clearRect(-.5,-.5,1,1));a=this.getData(a);void 0!=a.tile&&(ASSERT(mainContext==this.context),drawTile(b,vec2(1),a.tile,this.tileSize,a.color,a.direction*PI/2,a.mirror))}drawAllTileData(){for(let a=this.size.x;a--;)for(let b=this.size.y;b--;)this.drawTileData(vec2(a,b))}drawCanvas2D(a,b,c=0,d,e){const f=this.context;f.save();a=a.subtract(this.pos).multiply(this.tileSize);b=b.multiply(this.tileSize);f.translate(a.x,this.canvas.height-a.y);f.rotate(c);f.scale(d?-b.x:b.x,b.y);e(f);f.restore()}drawTile(a,b=vec2(1),c=-1,d=tileSizeDefault,e=new Color,f,h){this.drawCanvas2D(a,b,f,h,k=>{if(0>c)k.fillStyle=e.rgba(),k.fillRect(-.5,-.5,1,1);else{const l=tileImage.width/d.x;k.globalAlpha=e.a;k.drawImage(tileImage,c%l*d.x,(c/l|0)*d.x,d.x,d.y,-.5,-.5,1,1)}})}drawRect(a,b,c,d){this.drawTile(a,b,-1,0,c,d)}}"use strict";class ParticleEmitter extends EngineObject{constructor(a,b=0,c=0,d=100,e=PI,f=-1,h=tileSizeDefault,k=new Color,l=new Color,n=new Color(1,1,1,0),m=new Color(1,1,1,0),g=.5,u=.1,w=1,v=.1,A=.05,q=1,B=1,x=0,C=PI,r=.1,E=.2,y,t,F=1,p=t?1e9:0){super(a,new Vector2,f,h,0,void 0,p);this.emitSize=b;this.emitTime=c;this.emitRate=d;this.emitConeAngle=e;this.colorStartA=k;this.colorStartB=l;this.colorEndA=n;this.colorEndB=m;this.randomColorLinear=F;this.particleTime=g;this.sizeStart=u;this.sizeEnd=w;this.speed=v;this.angleSpeed=A;this.damping=q;this.angleDamping=B;this.gravityScale=x;this.particleConeAngle=C;this.fadeRate=r;this.randomness=E;this.collideTiles=y;this.additive=t;this.emitTimeBuffer=this.trailScale=0}update(){this.parent&&super.update();if(!this.emitTime||this.getAliveTime()<=this.emitTime){if(this.emitRate*particleEmitRateScale){const a=1/this.emitRate/particleEmitRateScale;for(this.emitTimeBuffer+=timeDelta;0<this.emitTimeBuffer;this.emitTimeBuffer-=a)this.emitParticle()}}else this.destroy();debugParticles&&debugRect(this.pos,vec2(this.emitSize),"#0f0",0,this.angle)}emitParticle(){var a=void 0!=this.emitSize.x?new Vector2(rand(-.5,.5),rand(-.5,.5)).multiply(this.emitSize).rotate(this.angle):randInCircle(.5*this.emitSize);a=new Particle(this.pos.add(a),this.tileIndex,this.tileSize,this.angle+rand(this.particleConeAngle,-this.particleConeAngle));const b=this.randomness;var c=m=>m+m*rand(b,-b);const d=c(this.particleTime),e=c(this.sizeStart),f=c(this.sizeEnd),h=c(this.speed);c=c(this.angleSpeed)*randSign();const k=rand(this.emitConeAngle,-this.emitConeAngle),l=randColor(this.colorStartA,this.colorStartB,this.randomColorLinear),n=randColor(this.colorEndA,this.colorEndB,this.randomColorLinear);a.colorStart=l;a.colorEndDelta=n.subtract(l);a.velocity=(new Vector2).setAngle(this.angle+k,h);a.angleVelocity=c;a.lifeTime=d;a.sizeStart=e;a.sizeEndDelta=f-e;a.fadeRate=this.fadeRate;a.damping=this.damping;a.angleDamping=this.angleDamping;a.elasticity=this.elasticity;a.friction=this.friction;a.gravityScale=this.gravityScale;a.collideTiles=this.collideTiles;a.additive=this.additive;a.renderOrder=this.renderOrder;a.trailScale=this.trailScale;a.mirror=.5>rand();a.destroyCallback=this.particleDestroyCallback;this.particleCreateCallback&&this.particleCreateCallback(a);return a}render(){}}class Particle extends EngineObject{constructor(a,b,c,d){super(a,new Vector2,b,c,d)}render(){const a=min((time-this.spawnTime)/this.lifeTime,1);var b=this.sizeStart+a*this.sizeEndDelta;b=new Vector2(b,b);var c=this.fadeRate/2;c=new Color(this.colorStart.r+a*this.colorEndDelta.r,this.colorStart.g+a*this.colorEndDelta.g,this.colorStart.b+a*this.colorEndDelta.b,(this.colorStart.a+a*this.colorEndDelta.a)*(a<c?a/c:a>1-c?(1-a)/c:1));this.additive&&setBlendMode(1);if(this.trailScale){var d=this.velocity.length();const e=this.velocity.scale(1/d);d*=this.trailScale;b.y=max(b.x,d);this.angle=e.angle();drawTile(this.pos.add(e.multiply(vec2(0,-d/2))),b,this.tileIndex,this.tileSize,c,this.angle,this.mirror)}else drawTile(this.pos,b,this.tileIndex,this.tileSize,c,this.angle,this.mirror);this.additive&&setBlendMode();debugParticles&&debugRect(this.pos,b,"#f005",0,this.angle);1==a&&(this.color=c,this.size=b,this.destroyCallback&&this.destroyCallback(this),this.destroyed=1)}}"use strict";const medals=[];let medalsPreventUnlock,newgrounds,medalsDisplayQueue=[],medalsSaveName,medalsDisplayTimeLast;function medalsInit(a){medalsSaveName=a;debugMedals||medals.forEach(b=>b.unlocked=1)}class Medal{constructor(a,b,c="",d="🏆",e){ASSERT(0<=a&&!medals[a]);medals[this.id=a]=this;this.name=b;this.description=c;this.icon=d;this.image=new Image;e&&(this.image.src=e)}unlock(){medalsPreventUnlock||this.unlocked||(ASSERT(medalsSaveName),localStorage[this.storageKey()]=this.unlocked=1,medalsDisplayQueue.push(this),newgrounds&&newgrounds.unlockMedal(this.id),localStorage["OS13kTrophy,"+this.icon+","+medalsSaveName+","+this.name]=this.description)}render(a=0){const b=overlayContext,c=min(medalDisplayWidth,mainCanvas.width),d=overlayCanvas.width-c;a*=-medalDisplayHeight;b.save();b.beginPath();b.fillStyle="#ddd";b.fill(b.rect(d,a,c,medalDisplayHeight));b.strokeStyle="#000";b.lineWidth=3;b.stroke();b.clip();this.renderIcon(d+15+medalDisplayIconSize/2,a+medalDisplayHeight/2);b.textAlign="left";b.font="38px "+fontDefault;b.fillText(this.name,d+medalDisplayIconSize+30,a+28);b.font="24px "+fontDefault;b.fillText(this.description,d+medalDisplayIconSize+30,a+60);b.restore()}renderIcon(a,b,c=medalDisplayIconSize){const d=overlayContext;d.fillStyle="#000";d.textAlign="center";d.textBaseline="middle";d.font=.7*c+"px "+fontDefault;this.image.src?d.drawImage(this.image,a-c/2,b-c/2,c,c):d.fillText(this.icon,a,b)}storageKey(){return medalsSaveName+"_"+this.id}}function medalsRender(){if(medalsDisplayQueue.length){var a=medalsDisplayQueue[0],b=timeReal-medalsDisplayTimeLast;if(medalsDisplayTimeLast)if(b>medalDisplayTime)medalsDisplayQueue.shift(medalsDisplayTimeLast=0);else{const c=medalDisplayTime-medalDisplaySlideTime;a.render(b<medalDisplaySlideTime?1-b/medalDisplaySlideTime:b>c?(b-c)/medalDisplaySlideTime:0)}else medalsDisplayTimeLast=timeReal}}class Newgrounds{constructor(a,b){ASSERT(!newgrounds&&a);this.app_id=a;this.cipher=b;this.host=location?location.hostname:"";b&&(this.cryptoJS=CryptoJS());this.session_id=new URL(window.location.href).searchParams.get("ngio_session_id")||0;if(0!=this.session_id){this.medals=(a=this.call("Medal.getList"))?a.result.data.medals:[];debugMedals&&console.log(this.medals);for(var c of this.medals)if(a=medals[c.id])a.image.src=c.icon,a.name=c.name,a.description=c.description,a.unlocked=c.unlocked,a.difficulty=c.difficulty,a.value=c.value,a.value&&(a.description=a.description+" ("+a.value+")");this.scoreboards=(c=this.call("ScoreBoard.getBoards"))?c.result.data.scoreboards:[];debugMedals&&console.log(this.scoreboards)}}unlockMedal(a){return this.call("Medal.unlock",{id:a},1)}postScore(a,b){return this.call("ScoreBoard.postScore",{id:a,value:b},1)}logView(){return this.call("App.logView",{host:this.host},1)}getScores(a,b=0,c=0,d=0,e=10){return this.call("ScoreBoard.getScores",{id:a,user:b,social:c,skip:d,limit:e})}call(a,b=0,c=0){a={component:a,parameters:b};if(this.cipher){b=this.cryptoJS;var d=b.enc.Base64.parse(this.cipher);const e=b.lib.WordArray.random(16);d=b.AES.encrypt(JSON.stringify(a),d,{iv:e});a.secure=b.enc.Base64.stringify(e.concat(d.ciphertext));a.parameters=0}b={app_id:this.app_id,session_id:this.session_id,call:a};a=new FormData;a.append("input",JSON.stringify(b));b=new XMLHttpRequest;b.open("POST","https://newgrounds.io/gateway_v3.php",!debugMedals&&c);b.send(a);debugMedals&&console.log(b.responseText);return b.responseText&&JSON.parse(b.responseText)}}const CryptoJS=()=>eval(Function("[M='GBMGXz^oVYPPKKbB`agTXU|LxPc_ZBcMrZvCr~wyGfWrwk@ATqlqeTp^N?p{we}jIpEnB_sEr`l?YDkDhWhprc|Er|XETG?pTl`e}dIc[_N~}fzRycIfpW{HTolvoPB_FMe_eH~BTMx]yyOhv?biWPCGc]kABencBhgERHGf{OL`Dj`c^sh@canhy[secghiyotcdOWgO{tJIE^JtdGQRNSCrwKYciZOa]Y@tcRATYKzv|sXpboHcbCBf`}SKeXPFM|RiJsSNaIb]QPc[D]Jy_O^XkOVTZep`ONmntLL`Qz~UupHBX_Ia~WX]yTRJIxG`ioZ{fefLJFhdyYoyLPvqgH?b`[TMnTwwfzDXhfM?rKs^aFr|nyBdPmVHTtAjXoYUloEziWDCw_suyYT~lSMksI~ZNCS[Bex~j]Vz?kx`gdYSEMCsHpjbyxQvw|XxX_^nQYue{sBzVWQKYndtYQMWRef{bOHSfQhiNdtR{o?cUAHQAABThwHPT}F{VvFmgN`E@FiFYS`UJmpQNM`X|tPKHlccT}z}k{sACHL?Rt@MkWplxO`ASgh?hBsuuP|xD~LSH~KBlRs]t|l|_tQAroDRqWS^SEr[sYdPB}TAROtW{mIkE|dWOuLgLmJrucGLpebrAFKWjikTUzS|j}M}szasKOmrjy[?hpwnEfX[jGpLt@^v_eNwSQHNwtOtDgWD{rk|UgASs@mziIXrsHN_|hZuxXlPJOsA^^?QY^yGoCBx{ekLuZzRqQZdsNSx@ezDAn{XNj@fRXIwrDX?{ZQHwTEfu@GhxDOykqts|n{jOeZ@c`dvTY?e^]ATvWpb?SVyg]GC?SlzteilZJAL]mlhLjYZazY__qcVFYvt@|bIQnSno@OXyt]OulzkWqH`rYFWrwGs`v|~XeTsIssLrbmHZCYHiJrX}eEzSssH}]l]IhPQhPoQ}rCXLyhFIT[clhzYOvyHqigxmjz`phKUU^TPf[GRAIhNqSOdayFP@FmKmuIzMOeoqdpxyCOwCthcLq?n`L`tLIBboNn~uXeFcPE{C~mC`h]jUUUQe^`UqvzCutYCgct|SBrAeiYQW?X~KzCz}guXbsUw?pLsg@hDArw?KeJD[BN?GD@wgFWCiHq@Ypp_QKFixEKWqRp]oJFuVIEvjDcTFu~Zz]a{IcXhWuIdMQjJ]lwmGQ|]g~c]Hl]pl`Pd^?loIcsoNir_kikBYyg?NarXZEGYspt_vLBIoj}LI[uBFvm}tbqvC|xyR~a{kob|HlctZslTGtPDhBKsNsoZPuH`U`Fqg{gKnGSHVLJ^O`zmNgMn~{rsQuoymw^JY?iUBvw_~mMr|GrPHTERS[MiNpY[Mm{ggHpzRaJaoFomtdaQ_?xuTRm}@KjU~RtPsAdxa|uHmy}n^i||FVL[eQAPrWfLm^ndczgF~Nk~aplQvTUpHvnTya]kOenZlLAQIm{lPl@CCTchvCF[fI{^zPkeYZTiamoEcKmBMfZhk_j_~Fjp|wPVZlkh_nHu]@tP|hS@^G^PdsQ~f[RqgTDqezxNFcaO}HZhb|MMiNSYSAnQWCDJukT~e|OTgc}sf[cnr?fyzTa|EwEtRG|I~|IO}O]S|rp]CQ}}DWhSjC_|z|oY|FYl@WkCOoPuWuqr{fJu?Brs^_EBI[@_OCKs}?]O`jnDiXBvaIWhhMAQDNb{U`bqVR}oqVAvR@AZHEBY@depD]OLh`kf^UsHhzKT}CS}HQKy}Q~AeMydXPQztWSSzDnghULQgMAmbWIZ|lWWeEXrE^EeNoZApooEmrXe{NAnoDf`m}UNlRdqQ@jOc~HLOMWs]IDqJHYoMziEedGBPOxOb?[X`KxkFRg@`mgFYnP{hSaxwZfBQqTm}_?RSEaQga]w[vxc]hMne}VfSlqUeMo_iqmd`ilnJXnhdj^EEFifvZyxYFRf^VaqBhLyrGlk~qowqzHOBlOwtx?i{m~`n^G?Yxzxux}b{LSlx]dS~thO^lYE}bzKmUEzwW^{rPGhbEov[Plv??xtyKJshbG`KuO?hjBdS@Ru}iGpvFXJRrvOlrKN?`I_n_tplk}kgwSXuKylXbRQ]]?a|{xiT[li?k]CJpwy^o@ebyGQrPfF`aszGKp]baIx~H?ElETtFh]dz[OjGl@C?]VDhr}OE@V]wLTc[WErXacM{We`F|utKKjgllAxvsVYBZ@HcuMgLboFHVZmi}eIXAIFhS@A@FGRbjeoJWZ_NKd^oEH`qgy`q[Tq{x?LRP|GfBFFJV|fgZs`MLbpPYUdIV^]mD@FG]pYAT^A^RNCcXVrPsgk{jTrAIQPs_`mD}rOqAZA[}RETFz]WkXFTz_m{N@{W@_fPKZLT`@aIqf|L^Mb|crNqZ{BVsijzpGPEKQQZGlApDn`ruH}cvF|iXcNqK}cxe_U~HRnKV}sCYb`D~oGvwG[Ca|UaybXea~DdD~LiIbGRxJ_VGheI{ika}KC[OZJLn^IBkPrQj_EuoFwZ}DpoBRcK]Q}?EmTv~i_Tul{bky?Iit~tgS|o}JL_VYcCQdjeJ_MfaA`FgCgc[Ii|CBHwq~nbJeYTK{e`CNstKfTKPzw{jdhp|qsZyP_FcugxCFNpKitlR~vUrx^NrSVsSTaEgnxZTmKc`R|lGJeX}ccKLsQZQhsFkeFd|ckHIVTlGMg`~uPwuHRJS_CPuN_ogXe{Ba}dO_UBhuNXby|h?JlgBIqMKx^_u{molgL[W_iavNQuOq?ap]PGB`clAicnl@k~pA?MWHEZ{HuTLsCpOxxrKlBh]FyMjLdFl|nMIvTHyGAlPogqfZ?PlvlFJvYnDQd}R@uAhtJmDfe|iJqdkYr}r@mEjjIetDl_I`TELfoR|qTBu@Tic[BaXjP?dCS~MUK[HPRI}OUOwAaf|_}HZzrwXvbnNgltjTwkBE~MztTQhtRSWoQHajMoVyBBA`kdgK~h`o[J`dm~pm]tk@i`[F~F]DBlJKklrkR]SNw@{aG~Vhl`KINsQkOy?WhcqUMTGDOM_]bUjVd|Yh_KUCCgIJ|LDIGZCPls{RzbVWVLEhHvWBzKq|^N?DyJB|__aCUjoEgsARki}j@DQXS`RNU|DJ^a~d{sh_Iu{ONcUtSrGWW@cvUjefHHi}eSSGrNtO?cTPBShLqzwMVjWQQCCFB^culBjZHEK_{dO~Q`YhJYFn]jq~XSnG@[lQr]eKrjXpG~L^h~tDgEma^AUFThlaR{xyuP@[^VFwXSeUbVetufa@dX]CLyAnDV@Bs[DnpeghJw^?UIana}r_CKGDySoRudklbgio}kIDpA@McDoPK?iYcG?_zOmnWfJp}a[JLR[stXMo?_^Ng[whQlrDbrawZeSZ~SJstIObdDSfAA{MV}?gNunLOnbMv_~KFQUAjIMj^GkoGxuYtYbGDImEYiwEMyTpMxN_LSnSMdl{bg@dtAnAMvhDTBR_FxoQgANniRqxd`pWv@rFJ|mWNWmh[GMJz_Nq`BIN@KsjMPASXORcdHjf~rJfgZYe_uulzqM_KdPlMsuvU^YJuLtofPhGonVOQxCMuXliNvJIaoC?hSxcxKVVxWlNs^ENDvCtSmO~WxI[itnjs^RDvI@KqG}YekaSbTaB]ki]XM@[ZnDAP~@|BzLRgOzmjmPkRE@_sobkT|SszXK[rZN?F]Z_u}Yue^[BZgLtR}FHzWyxWEX^wXC]MJmiVbQuBzkgRcKGUhOvUc_bga|Tx`KEM`JWEgTpFYVeXLCm|mctZR@uKTDeUONPozBeIkrY`cz]]~WPGMUf`MNUGHDbxZuO{gmsKYkAGRPqjc|_FtblEOwy}dnwCHo]PJhN~JoteaJ?dmYZeB^Xd?X^pOKDbOMF@Ugg^hETLdhwlA}PL@_ur|o{VZosP?ntJ_kG][g{Zq`Tu]dzQlSWiKfnxDnk}KOzp~tdFstMobmy[oPYjyOtUzMWdjcNSUAjRuqhLS@AwB^{BFnqjCmmlk?jpn}TksS{KcKkDboXiwK]qMVjm~V`LgWhjS^nLGwfhAYrjDSBL_{cRus~{?xar_xqPlArrYFd?pHKdMEZzzjJpfC?Hv}mAuIDkyBxFpxhstTx`IO{rp}XGuQ]VtbHerlRc_LFGWK[XluFcNGUtDYMZny[M^nVKVeMllQI[xtvwQnXFlWYqxZZFp_|]^oWX[{pOMpxXxvkbyJA[DrPzwD|LW|QcV{Nw~U^dgguSpG]ClmO@j_TENIGjPWwgdVbHganhM?ema|dBaqla|WBd`poj~klxaasKxGG^xbWquAl~_lKWxUkDFagMnE{zHug{b`A~IYcQYBF_E}wiA}K@yxWHrZ{[d~|ARsYsjeNWzkMs~IOqqp[yzDE|WFrivsidTcnbHFRoW@XpAV`lv_zj?B~tPCppRjgbbDTALeFaOf?VcjnKTQMLyp{NwdylHCqmo?oelhjWuXj~}{fpuX`fra?GNkDiChYgVSh{R[BgF~eQa^WVz}ATI_CpY?g_diae]|ijH`TyNIF}|D_xpmBq_JpKih{Ba|sWzhnAoyraiDvk`h{qbBfsylBGmRH}DRPdryEsSaKS~tIaeF[s]I~xxHVrcNe@Jjxa@jlhZueLQqHh_]twVMqG_EGuwyab{nxOF?`HCle}nBZzlTQjkLmoXbXhOtBglFoMz?eqre`HiE@vNwBulglmQjj]DB@pPkPUgA^sjOAUNdSu_`oAzar?n?eMnw{{hYmslYi[TnlJD'",..."]charCodeAtUinyxpf","for(;e<10359;c[e++]=p-=128,A=A?p-A&&A:p==34&&p)for(p=1;p<128;y=f.map((n,x)=>(U=r[n]*2+1,U=Math.log(U/(h-U)),t-=a[x]*U,U/500)),t=~-h/(1+Math.exp(t))|1,i=o%h<t,o=o%h+(i?t:h-t)*(o>>17)-!i*t,f.map((n,x)=>(U=r[n]+=(i*h/2-r[n]<<13)/((C[n]+=C[n]<5)+1/20)>>13,a[x]+=y[x]*(i-t/h))),p=p*2+i)for(f='010202103203210431053105410642065206541'.split(t=0).map((n,x)=>(U=0,[...n].map((n,x)=>(U=U*997+(c[e-n]|0)|0)),h*32-1&U*997+p+!!A*129)*12+x);o<h*32;o=o*64|M.charCodeAt(d++)&63);for(C=String.fromCharCode(...c);r=/[\0-#?@\\\\~]/.exec(C);)with(C.split(r))C=join(shift());return C")([],[],131072,[0,0,0,0,0,0,0,0,0,0,0,0],new Uint16Array(51e6).fill(32768),new Uint8Array(51e6),0,0,0,0));"use strict";let glCanvas,glContext,glTileTexture,glActiveTexture,glShader,glPositionData,glColorData,glBatchCount,glBatchAdditive,glAdditive;function glInit(){if(glEnable){glCanvas=document.createElement("canvas");glContext=glCanvas.getContext("webgl",{antialias:!1});glCanvas.style=styleCanvas;glTileTexture=glCreateTexture(tileImage);glOverlay&&document.body.appendChild(glCanvas);glShader=glCreateProgram("precision highp float;uniform mat4 m;attribute float a;attribute vec2 p,s,t;attribute vec4 c,b;varying vec2 v;varying vec4 d,e;void main(){gl_Position=m*vec4((s*cos(a)-vec2(-s.y,s)*sin(a))*.5+p,1,1);v=t;d=c;e=b;}","precision highp float;varying vec2 v;varying vec4 d,e;uniform sampler2D j;void main(){gl_FragColor=texture2D(j,v)*d+e;}");var a=new ArrayBuffer(gl_MAX_BATCH*gl_VERTICES_PER_QUAD*gl_VERTEX_BYTE_STRIDE);glCreateBuffer(gl_ARRAY_BUFFER,a.byteLength,gl_DYNAMIC_DRAW);glPositionData=new Float32Array(a);glColorData=new Uint32Array(a);var b=glBatchCount=0;a=(c,d,e,f,h=0)=>{c=glContext.getAttribLocation(glShader,c);glContext.enableVertexAttribArray(c);glContext.vertexAttribPointer(c,f,d,h,gl_VERTEX_BYTE_STRIDE,b);b+=f*e};a("a",gl_FLOAT,4,1);a("p",gl_FLOAT,4,2);a("s",gl_FLOAT,4,2);a("t",gl_FLOAT,4,2);a("c",gl_UNSIGNED_BYTE,1,4,1);a("b",gl_UNSIGNED_BYTE,1,4,1)}}function glSetBlendMode(a){glEnable&&(glAdditive=a)}function glSetTexture(a=glTileTexture){glEnable&&(a!=glActiveTexture&&glFlush(),glContext.bindTexture(gl_TEXTURE_2D,glActiveTexture=a))}function glCompileShader(a,b){if(glEnable){b=glContext.createShader(b);glContext.shaderSource(b,a);glContext.compileShader(b);if(debug&&!glContext.getShaderParameter(b,gl_COMPILE_STATUS))throw glContext.getShaderInfoLog(b);return b}}function glCreateProgram(a,b){if(glEnable){var c=glContext.createProgram();glContext.attachShader(c,glCompileShader(a,gl_VERTEX_SHADER));glContext.attachShader(c,glCompileShader(b,gl_FRAGMENT_SHADER));glContext.linkProgram(c);if(debug&&!glContext.getProgramParameter(c,gl_LINK_STATUS))throw glContext.getProgramInfoLog(c);return c}}function glCreateBuffer(a,b,c){if(glEnable){var d=glContext.createBuffer();glContext.bindBuffer(a,d);glContext.bufferData(a,b,c);return d}}function glCreateTexture(a){if(glEnable&&a&&a.width){var b=glContext.createTexture();glContext.bindTexture(gl_TEXTURE_2D,b);glContext.texImage2D(gl_TEXTURE_2D,0,gl_RGBA,gl_RGBA,gl_UNSIGNED_BYTE,a);glContext.texParameteri(gl_TEXTURE_2D,gl_TEXTURE_MIN_FILTER,cavasPixelated?gl_NEAREST:gl_LINEAR);glContext.texParameteri(gl_TEXTURE_2D,gl_TEXTURE_MAG_FILTER,cavasPixelated?gl_NEAREST:gl_LINEAR);glContext.texParameteri(gl_TEXTURE_2D,gl_TEXTURE_WRAP_S,gl_CLAMP_TO_EDGE);glContext.texParameteri(gl_TEXTURE_2D,gl_TEXTURE_WRAP_T,gl_CLAMP_TO_EDGE);return b}}function glPreRender(a,b,c,d,e){glEnable&&(glContext.viewport(0,0,glCanvas.width=a,glCanvas.height=b),glContext.clear(gl_COLOR_BUFFER_BIT),glContext.bindTexture(gl_TEXTURE_2D,glActiveTexture=glTileTexture),glContext.useProgram(glShader),glSetBlendMode(),a=2*e/a,b=2*e/b,glContext.uniformMatrix4fv(glContext.getUniformLocation(glShader,"m"),0,new Float32Array([a,0,0,0,0,b,0,0,1,1,-1,1,-1-a*c,-1-b*d,0,0])))}function glFlush(){if(glEnable&&glBatchCount){var a=glBatchAdditive?gl_ONE:gl_ONE_MINUS_SRC_ALPHA;glContext.blendFuncSeparate(gl_SRC_ALPHA,a,gl_ONE,a);glContext.enable(gl_BLEND);glContext.bufferSubData(gl_ARRAY_BUFFER,0,glPositionData.subarray(0,glBatchCount*gl_VERTICES_PER_QUAD*gl_INDICIES_PER_VERT));glContext.drawArrays(gl_TRIANGLES,0,glBatchCount*gl_VERTICES_PER_QUAD);glBatchCount=0;glBatchAdditive=glAdditive}}function glCopyToContext(a,b){glEnable&&glBatchCount&&(glFlush(),glOverlay&&!b||a.drawImage(glCanvas,0,0))}function glDraw(a,b,c,d,e,f,h,k,l,n=4294967295,m=0){if(glEnable){glBatchCount!=gl_MAX_BATCH&&glBatchAdditive==glAdditive||glFlush();var g=glBatchCount++*gl_VERTICES_PER_QUAD*gl_INDICIES_PER_VERT;glPositionData[g++]=e;glPositionData[g++]=a;glPositionData[g++]=b;glPositionData[g++]=-c;glPositionData[g++]=-d;glPositionData[g++]=f;glPositionData[g++]=l;glColorData[g++]=n;glColorData[g++]=m;glPositionData[g++]=e;glPositionData[g++]=a;glPositionData[g++]=b;glPositionData[g++]=c;glPositionData[g++]=d;glPositionData[g++]=k;glPositionData[g++]=h;glColorData[g++]=n;glColorData[g++]=m;glPositionData[g++]=e;glPositionData[g++]=a;glPositionData[g++]=b;glPositionData[g++]=-c;glPositionData[g++]=d;glPositionData[g++]=f;glPositionData[g++]=h;glColorData[g++]=n;glColorData[g++]=m;glPositionData[g++]=e;glPositionData[g++]=a;glPositionData[g++]=b;glPositionData[g++]=-c;glPositionData[g++]=-d;glPositionData[g++]=f;glPositionData[g++]=l;glColorData[g++]=n;glColorData[g++]=m;glPositionData[g++]=e;glPositionData[g++]=a;glPositionData[g++]=b;glPositionData[g++]=c;glPositionData[g++]=-d;glPositionData[g++]=k;glPositionData[g++]=l;glColorData[g++]=n;glColorData[g++]=m;glPositionData[g++]=e;glPositionData[g++]=a;glPositionData[g++]=b;glPositionData[g++]=c;glPositionData[g++]=d;glPositionData[g++]=k;glPositionData[g++]=h;glColorData[g++]=n;glColorData[g++]=m}}const gl_ONE=1,gl_TRIANGLES=4,gl_SRC_ALPHA=770,gl_ONE_MINUS_SRC_ALPHA=771,gl_BLEND=3042,gl_TEXTURE_2D=3553,gl_UNSIGNED_BYTE=5121,gl_FLOAT=5126,gl_RGBA=6408,gl_NEAREST=9728,gl_LINEAR=9729,gl_TEXTURE_MAG_FILTER=10240,gl_TEXTURE_MIN_FILTER=10241,gl_TEXTURE_WRAP_S=10242,gl_TEXTURE_WRAP_T=10243,gl_COLOR_BUFFER_BIT=16384,gl_CLAMP_TO_EDGE=33071,gl_ARRAY_BUFFER=34962,gl_DYNAMIC_DRAW=35048,gl_FRAGMENT_SHADER=35632,gl_VERTEX_SHADER=35633,gl_COMPILE_STATUS=35713,gl_LINK_STATUS=35714,gl_VERTICES_PER_QUAD=6,gl_INDICIES_PER_VERT=9,gl_MAX_BATCH=65536,gl_VERTEX_BYTE_STRIDE=36;
\ No newline at end of file
var tilesets = {};
var tilesetUidHash = {};
var Levels = {};
var fieldGetters = {
Point: function(field, level) {
return {cell: field.__value, position: [field.__value[0]*level.gridSize, field.__value[1]*level.gridSize]};
},
String: function(field) {
return field.__value;
}
};
var getValue = function(field, layer) {
var type = field.__type || 'String';
if(!(type in fieldGetters)){
console.warn('No getter for', type, field);
type = 'String';
}
return fieldGetters[type](field, layer);
};
var imagesHash = {};
var imageHashDestinations = {};
var colorFromHex = function(hex) {
hex = hex.replace(/^#/,'');
if(hex.length === 3)
hex = hex[0]+hex[0] + hex[1]+hex[1] + hex[2]+hex[2];
return [parseInt(hex[0]+hex[1], 16),parseInt(hex[2]+hex[3], 16),parseInt(hex[4]+hex[5], 16)];
};
var getImage = function(path, obj) {
var img;
if(imagesHash[path]){
imageHashDestinations[path].push(obj);
img = imagesHash[path];
}else{
img = document.createElement( 'img' );
img.onload = function() {
var canvas = document.createElement('canvas');
var w = canvas.width = img.naturalWidth,
h = canvas.height = img.naturalHeight;
var ctx = canvas.getContext('2d');
ctx.drawImage(img, 0, 0);
var data = ctx.getImageData(0,0, w, h );
var color = colorFromHex(gameConfig.transparent || '#0f0'),
dataEl = data.data;
for( var i = 0, _i = dataEl.length; i < _i; i+=4 ){
if(dataEl[ i ] === color[0] &&
dataEl[ i+1 ] === color[1] &&
dataEl[ i+2 ] === color[2])
dataEl[i+3] = 0;
}
ctx.putImageData(data, 0,0);
imagesHash[path] = canvas;
for( var i = 0, _i = imageHashDestinations[path].length; i < _i; i++ ){
var element = imageHashDestinations[path][ i ];
element.img = canvas;
}
}
imageHashDestinations[path] = [obj];
img.src = path;
imagesHash[path] = img;
}
return img;
}
var loadWorld = function(url){
World.fromURL( url ).then( async world => {
Levels = world.levelMap;
world.tilesetIds.forEach( tilesetID => {
var tileset = tilesets[ tilesetID ] = new Tileset( world, world.tilesetMap[ tilesetID ].data );
tileset.img = getImage(tileset.path, tileset);
tilesetUidHash[ tileset.uid ] = tileset;
} );
for( var levelName in Levels ){
var level = Levels[ levelName ];
level.layerHash = {};
level.getItems = function(type) {
return this.entitiesTypes[type] || [];
}
var entities = level.entities = [];
var entitiesTypes = level.entitiesTypes = {};
for( var i = 0, _i = level.layers.length; i < _i; i++ ){
var layer = level.layers[ i ];
var layerObj = {
autoLayerTiles: layer.data.autoLayerTiles.concat(layer.data.gridTiles),
gridSize: layer.gridSize,
__identifier: layer.data.__identifier,
name: layer.data.__identifier,
entities: layer.entities,
tileset: tilesetUidHash[ layer.data.__tilesetDefUid ],
width: layer.data.__cWid,
height: layer.data.__cHei,
grid: layer.data.intGrid
};
layer = level.layers[ i ] = layerObj;
level.layerHash[ layer.name ] = layerObj;
if( layer.entities ){
for( var j = 0, _j = layer.entities.length; j < _j; j++ ){
var entity = layer.entities[ j ];
var obj = {
id: entity.data.defUid,
type: entity.data.__identifier,
tile: entity.data.__tile,
width: entity.data.width,
cellWidth: entity.data.width / layer.gridSize,
height: entity.data.height,
cellHeight: entity.data.height / layer.gridSize,
position: entity.data.px,
cell: entity.data.__grid,
level: level
};
if( obj.tile && obj.tile.tilesetUid ){
obj.tile.tileset = tilesetUidHash[ obj.tile.tilesetUid ];
}
entity.data.fieldInstances.forEach( field => {
obj[ field.__identifier ] = getValue( field, layer );
} );
entities.push( obj );
}
}
layer.entities = [];
}
for( var i = 0, _i = entities.length; i < _i; i++ ){
var entity = entities[ i ];
if( entity.Layer ){
entity.layer = level.layerHash[ entity.Layer ];
if( gameConfig.objects[ entity.type ] ){
entities[ i ] = entity = new gameConfig.objects[ entity.type ]( entity );
}
level.layerHash[ entity.Layer ].entities.push( entity );
( entitiesTypes[ entity.type ] || ( entitiesTypes[ entity.type ] = [] ) ).push( entity );
}
}
for( var i = 0, _i = entities.length; i < _i; i++ ){
var entity = entities[ i ];
entity.init && entity.init();
}
}
} );
};
var gameConfig = {objects: {}};
var Game = function(cfg) {
gameConfig = cfg;
loadWorld(cfg.file);
};
Game.debugs = [];
var t = +new Date(), t2, dt, tfs = 0;
function loop(time) {
t2 = +new Date();
dt = (t2 - t)/1000;
t = t2;
if(dt>0.05)
dt = 0.05;
tfs += dt;
gameConfig.step && gameConfig.step(dt, tfs);
gameConfig.draw && gameConfig.draw(dt, tfs);
for( var i = 0, _i = Game.debugs.length; i < _i; i++ ){
Game.debugs[ i ]();
}
Game.debugs = [];
window.requestAnimationFrame(loop);
}
window.requestAnimationFrame(loop)
var mainCanvas = c1;
var ctx = c1.getContext('2d');
ctx.imageSmoothingEnabled = false;
var w = 1600;
var h = 1024;
var Camera = {
position: [w/2, h/2],
scale: 8,
transformX: function(x) {
return ((x-this.position[0]*this.scale+w/2)|0);
},
transformY: function(y) {
return y-this.position[1]*this.scale+h/2 |0;
}
};
var _renderTile = function(tile) {
};
var renderTile = function(layer, tile) {
renderTiles(layer, [tile]);
}
var drawImageFlipsRotates = function(img, sx,sy,sw,sh, dx,dy,dw,dh, flip, rotate) {
dx = Camera.transformX(dx);
dy = Camera.transformY(dy);
if(dx>w || dy > h || dx+dw<0 || dy+dh<0)
return;
dw|=0;
dh|=0;
dx|=0;
dy|=0;
if(flip === 1){
ctx.save();
ctx.translate( dx + dw, dy );
ctx.scale( -1, 1 );
ctx.drawImage( img, sx,sy,sw,sh, 0,0,dw,dh );
ctx.restore();
}else{
ctx.drawImage( img, sx, sy, sw, sh, dx, dy, dw, dh );
}
};
var renderTiles = function(layer, tiles) {
var scale = Camera.scale;
var tileset = layer.tileset,//tilesetUidHash[layer.__tilesetDefUid],
gridSize = tileset && tileset.gridSize,
scaledGridSize = gridSize*scale;
if(tiles && tiles.length){
for( var i = 0, _i = tiles.length; i < _i; i++ ){
var tile = tiles[ i ];
drawImageFlipsRotates(
tileset.img,
tile.src[ 0 ], tile.src[ 1 ], gridSize, gridSize,
tile.px[ 0 ] * scale, tile.px[ 1 ] * scale, scaledGridSize, scaledGridSize,
tile.f
);
}
}
};
var renderObject = function(obj) {
var scale = Camera.scale;
var tileset = obj.tile.tileset,
gridSize = tileset.gridSize,
tile = obj.tile;
drawImageFlipsRotates(
tileset.img,
tile.srcRect[ 0 ], tile.srcRect[ 1 ], tile.srcRect[ 2 ], tile.srcRect[ 3 ],
obj.position[0] * scale, obj.position[1] * scale, obj.width*scale, obj.height*scale,
tile.f
)
};
var clear = function() {
ctx.fillStyle = gameConfig.background || '#171c39';
ctx.fillRect(0,0,w,h);
};
var render = function(level) {
if(!level)
return;
var layers = level.layers;
for( var l = layers.length; l--; ){
var layer = layers[ l ];
renderTiles(layer, layer.autoLayerTiles);
var entities = layer.entities;
if(entities){
for( var i = 0, _i = entities.length; i < _i; i++ ){
var entity = entities[ i ];
entity.draw && entity.draw(ctx, layer);
}
}
}
};
var physic = function(level, dt, tfs) {
if(!level)
return;
var layers = level.layers;
for( var l = layers.length; l--; ){
var layer = layers[ l ];
var t = +new Date();
var entities = layer.entities;
if(entities){
for( var i = 0, _i = entities.length; i < _i; i++ ){
var entity = entities[ i ];
entity.step && entity.step(dt, tfs);
for(var a = entity.animations.length-1; a>=0; a--){
var animation = entity.animations[a],
percent = Math.max(0, Math.min(1, (t/1000-(animation.start+animation.wait))/animation.duration));
animation.fn.call(entity, percent);
if(percent === 1){
entity.animations.splice(a, 1);
}
}
}
}
}
};
var GameObject = function(cfg) {
Object.assign(this, cfg);
this.collisionOffset = [0,0,0,0];
this.animations = [];
this.animationsHash = {};
this.spriteAnimations = {};
this.saying = false;
};
GameObject.prototype = {
visible: true,
opacity: 1,
say: function( sentence, duration) {
duration = duration || sentence.length/8;
var actions = [];
sentence = sentence.split('\n');
var maxLength = 0;
for( var i = 0, _i = sentence.length; i < _i; i++ ){
var sentenceElement = sentence[ i ];
sentence[ i ] = sentenceElement = sentenceElement.replace(/\[>([^\]]+)\]/g, function(a,b){
actions.push(b);
return '';
})
maxLength = Math.max(sentenceElement.length, maxLength);
}
this.saying = {
sentence: sentence.join('\n'),
duration,
maxLength,
rowsCount: sentence.length,
length: sentence.join('\n').length,
start: +new Date(),
currentChar: 0,
actions
};
},
sayRender: function(cfg) {
if(this.saying){
var saying = this.saying;
var currentChar = (+new Date() - saying.start)/1000 / (saying.duration/saying.length);
saying.currentChar = Math.floor(currentChar);
saying.currentChar = Math.min(Math.max(0, saying.currentChar), saying.length+4);
var part = saying.sentence.substr(0, saying.currentChar);
var place = cfg.place || [-1, -1];
var position = cfg.position || [0, 0];
var padding = cfg.padding || [2, 2];
var offset = cfg.offset || [0, 2];
var symbolWidth = 2, symbolHeight = 5;
if(place[0] === -1){
var sx = ( this.position[ 0 ]+position[0] - ( saying.maxLength ) * symbolWidth ) * Camera.scale;
}
if(place[1] === -1){
var sy = ( this.position[ 1 ]+position[1] - saying.rowsCount * symbolHeight ) * Camera.scale;
}
if(cfg.background){
ctx.fillStyle = cfg.background;
ctx.fillRect(
Camera.transformX(sx-(padding[0]+offset[0])*Camera.scale),
Camera.transformY(sy-(padding[1]+offset[1])*Camera.scale),
saying.maxLength * symbolWidth * Camera.scale+padding[0]*2*Camera.scale,
saying.rowsCount * symbolHeight * Camera.scale +padding[1]*2*Camera.scale)
}
if(cfg.border){
ctx.strokeStyle = cfg.border;
ctx.lineWidth = Camera.scale
ctx.strokeRect(
Camera.transformX(sx-(padding[0]+offset[0])*Camera.scale),
Camera.transformY(sy-(padding[1]+offset[1])*Camera.scale),
saying.maxLength * symbolWidth * Camera.scale+padding[0]*2*Camera.scale,
saying.rowsCount * symbolHeight * Camera.scale +padding[1]*2*Camera.scale)
}
ctx.fillStyle = cfg.color || '#fff';
ctx.font = '24px Tahoma';
var currentRow = 0, currentCol = 0;
for(var i = 0, _i = part.length; i< _i; i++){
var entropy = _i/(currentChar-i)*8;
if(part[i] === '\n'){
currentRow++;
currentCol = 0;
continue
}
ctx.fillText(part[i],
Camera.transformX(sx + currentCol*symbolWidth * Camera.scale),
Camera.transformY(sy+currentRow*symbolHeight* Camera.scale+Math.sin(entropy)),
)
currentCol++;
}
if(this.saying.currentChar >= this.saying.length+4){
if(saying.actions){
if(this.actions){
saying.actions.forEach(act=>{
if(this.actions[act]){
this.actions[act].call(this);
}else{
console.error('No action called', act, 'in object', this)
}
})
}
}
this.saying = false;
}
}
},
animate: function(name, fn, duration, wait) {
if(!(name in this.animationsHash)){
this.animationsHash[name] = true;
this.animations.push( { fn, duration, wait: wait || 0, start: +new Date()/1000 } );
}
},
wouldCollide: function(position, layers) {
for( var i = 0, _i = layers.length; i < _i; i++ ){
let layer = layers[ i ];
layer = this.level.layerHash[layer];
if(!layer){
console.error( 'Layer', layers[ i ], 'does not exist' )
continue
}
var grid = layer.grid;
let gs = layer.gridSize;
for(var x = position[0]+this.collisionOffset[0], _x = Math.ceil((position[0]+this.width-this.collisionOffset[2])/gs)*gs; x < _x; x+= gs){
for(var y = position[1]+this.collisionOffset[1], _y = Math.ceil((position[1]+this.height-this.collisionOffset[3])/gs)*gs; y < _y; y+= gs){
let cx = Math.floor(x/gs),
cy = Math.floor(y/gs);
if(this.DEBUG){
Game.debugs.push( () => {
var scale = Camera.scale;
ctx.strokeStyle = '#e25002';
ctx.strokeRect( Camera.transformX(cx * gs * scale), Camera.transformY(cy * gs * scale), gs * scale, gs * scale )
} );
}
if(grid[cx+cy*layer.width])
return true;
}
}
}
return false;
},
terraform: function(tiles, state) {
if(this._terraformState !== state){
this._terraformState = state;
var gridSize = this.layer.gridSize
for( var i = 0, _i = tiles.length; i < _i; i++ ){
var tile = tiles[ i ];
this.layer.grid[tile.px[0]/gridSize+tile.px[1]/gridSize*this.layer.width] = state-0;
}
}
},
extractTiles: function() {
this._terraformState = true;
var allTiles = this.layer.autoLayerTiles;
var out = [];
for( var i = allTiles.length-1; i>-1;i-- ){
var tile = allTiles[ i ];
if(
tile.px[0]>=this.position[0] &&
tile.px[1]>=this.position[1] &&
tile.px[0]<=this.position[0]+this.width &&
tile.px[1]<=this.position[1]+this.height
){
out.push(allTiles.splice(i, 1)[0])
}
}
return out;
},
extendSprite: function() {
var sw = this.tile.srcRect[2];
var sh = this.tile.srcRect[3];
if(sw/this.width>sh/this.height){
this.tile.srcRect[3] = sw/this.width*this.height;
}else{
this.tile.srcRect[2] = sh/this.height*this.width;
}
},
render: function() {
if(this.visible && this.opacity>0){
if(this.opacity<1){
ctx.save();
ctx.globalAlpha = this.opacity;
}
renderObject( this );
if(this.opacity<1){
ctx.restore();
}
}
},
renderTiles: function(tiles) {
if(this.visible && this.opacity>0){
if( this.opacity < 1 ){
ctx.save();
ctx.globalAlpha = this.opacity;
}
renderTiles(this.layer, this.tiles);
if( this.opacity < 1 ){
ctx.restore();
}
}
},
draw: function() {
this.render();
},
debug: function() {
var scale = Camera.scale;
var obj = this;
ctx.strokeStyle = '#007bff';
ctx.strokeRect(Camera.transformX(obj.position[0] * scale), Camera.transformY(obj.position[1] * scale), obj.width*scale, obj.height*scale);
ctx.strokeStyle = '#ff00c8';
ctx.strokeRect(Camera.transformX((obj.position[0]+obj.collisionOffset[0]) * scale),
Camera.transformY((obj.position[1]+obj.collisionOffset[1]) * scale),
(obj.width-obj.collisionOffset[0]-obj.collisionOffset[2])*scale,
(obj.height-obj.collisionOffset[1]-obj.collisionOffset[3])*scale);
},
collide: function(type) {
var its = this.level.getItems(typeof type === 'string' ? type : type.name);
for( var i = 0, _i = its.length; i < _i; i++ ){
var it = its[ i ];
if(this.position[0]+this.width-this.collisionOffset[2] < it.position[0]+it.collisionOffset[0] ||
this.position[0]+this.collisionOffset[0] > it.position[0] + it.width-it.collisionOffset[2] ||
this.position[1]+this.height -this.collisionOffset[3]< it.position[1]+it.collisionOffset[1] ||
this.position[1]+this.collisionOffset[1] > it.position[1] + it.height-it.collisionOffset[3]){
continue;
}
return true;
}
return false;
},
getAll: function(type, filter) {
var its = this.level.getItems(typeof type === 'string' ? type : type.name);
if(filter){
return its.filter(function(obj) {
for(var i in filter){
if(obj[i] !== filter[i])
return false;
}
return true;
})
}
},
getItem: function(type, filter) {
var its = this.level.getItems(typeof type === 'string' ? type : type.name);
if(filter){
return its.filter(function(obj) {
for(var i in filter){
if(obj[i] !== filter[i])
return false;
}
return true;
})[0]
}
},
loadAnimation: function(animationName, {manual, duration, path, size, frames, offset, padding}) {
var animation = this.spriteAnimations[animationName] = {
name: animationName,
size,
frames,
offset,
padding,
duration,
currentFrame: 0,
time: 0,
manual
};
animation.img = getImage(path, animation);
if(!this.currentAnimation){
this.currentAnimation = animation;
}
},
setAnimation: function(name, frame) {
if(name !== false){
this.currentAnimation = this.spriteAnimations[ name ];
}
var animation = this.currentAnimation;
if( frame !== void 0 )
animation.currentFrame = frame;
animation.currentFrame = animation.currentFrame % animation.frames;
this.tile = {
f: this.tile.f,
srcRect: [
animation.currentFrame*animation.size[0], 0,
animation.size[0], animation.size[1]
],
tileset: {
img: animation.img,
gridSize: animation.size[0]
}
};
},
updateAnimation: function(dt) {
var animation = this.currentAnimation;
animation.time += dt;
if(animation.time>animation.duration)
animation.time -= animation.duration;
var frame = animation.manual ? animation.currentFrame : Math.floor(animation.time/(animation.duration/animation.frames));
if(frame !== animation.currentFrame){
this.setAnimation(false, frame);
this.onFrameChange && this.onFrameChange(animation.name, frame)
}
}
};
var Keys = keys = {};
var keyMapping = {
'ArrowUp': 'Up',
'Space': 'Up',
'w': 'Up',
'KeyW': 'Up',
'ArrowDown': 'Down',
's': 'Down',
'KeyS': 'Down',
'ArrowRight': 'Right',
'd': 'Right',
'KeyD': 'Right',
'ArrowLeft': 'Left',
'a': 'Left',
'KeyA': 'Left',
};
document.addEventListener('keydown', function(e){
keys[keyMapping[e.code]] = true;
});
document.addEventListener('keyup', function(e){
console.log(e.code)
keys[keyMapping[e.code]] = false;
});
\ No newline at end of file
;( function( e ){
"use strict";
function t( e, t, i, n ){
return new ( i || ( i = Promise ) )( ( function( r, o ){
function a( e ){
try{
u( n.next( e ) )
}catch( e ){
o( e )
}
}
function s( e ){
try{
u( n.throw( e ) )
}catch( e ){
o( e )
}
}
function u( e ){
var t;
e.done ? r( e.value ) : ( t = e.value, t instanceof i ? t : new i( ( function( e ){
e( t )
} ) ) ).then( a, s )
}
u( ( n = n.apply( e, t || [] ) ).next() )
} ) )
}
function i( e, t ){
var i, n, r, o, a = {
label: 0, sent: function(){
if( 1 & r[ 0 ] ) throw r[ 1 ];
return r[ 1 ]
}, trys: [], ops: []
};
return o = {
next: s( 0 ),
throw: s( 1 ),
return: s( 2 )
}, "function" == typeof Symbol && ( o[ Symbol.iterator ] = function(){
return this
} ), o;
function s( o ){
return function( s ){
return function( o ){
if( i ) throw new TypeError( "Generator is already executing." );
for( ; a; ) try{
if( i = 1, n && ( r = 2 & o[ 0 ] ? n.return : o[ 0 ] ? n.throw || ( ( r = n.return ) && r.call( n ), 0 ) : n.next ) && !( r = r.call( n, o[ 1 ] ) ).done ) return r;
switch( n = 0, r && ( o = [ 2 & o[ 0 ], r.value ] ), o[ 0 ] ){
case 0:
case 1:
r = o;
break;
case 4:
return a.label++, { value: o[ 1 ], done: !1 };
case 5:
a.label++, n = o[ 1 ], o = [ 0 ];
continue;
case 7:
o = a.ops.pop(), a.trys.pop();
continue;
default:
if( !( r = a.trys, ( r = r.length > 0 && r[ r.length - 1 ] ) || 6 !== o[ 0 ] && 2 !== o[ 0 ] ) ){
a = 0;
continue
}
if( 3 === o[ 0 ] && ( !r || o[ 1 ] > r[ 0 ] && o[ 1 ] < r[ 3 ] ) ){
a.label = o[ 1 ];
break
}
if( 6 === o[ 0 ] && a.label < r[ 1 ] ){
a.label = r[ 1 ], r = o;
break
}
if( r && a.label < r[ 2 ] ){
a.label = r[ 2 ], a.ops.push( o );
break
}
r[ 2 ] && a.ops.pop(), a.trys.pop();
continue
}
o = t.call( e, a )
}catch( e ){
o = [ 6, e ], n = 0
}finally{
i = r = 0
}
if( 5 & o[ 0 ] ) throw o[ 1 ];
return { value: o[ 0 ] ? o[ 1 ] : void 0, done: !0 }
}( [ o, s ] )
}
}
}
var n = "undefined" != typeof window && void 0 !== window.document, r = function(){
if( n ) return function( e ){
return t( this, void 0, void 0, ( function(){
return i( this, ( function( t ){
switch( t.label ){
case 0:
return [ 4, fetch( e ) ];
case 1:
return [ 4, t.sent().json() ];
case 2:
return [ 2, t.sent() ]
}
} ) )
} ) )
};
var e = require( "fs" );
return function( n ){
return t( this, void 0, void 0, ( function(){
return i( this, ( function( t ){
return [ 2, new Promise( ( function( t, i ){
e.readFile( n, { encoding: "utf-8" }, ( function( e, n ){
null != e && i( e ), t( JSON.parse( n ) )
} ) )
} ) ) ]
} ) )
} ) )
}
}(), o = Object.freeze( { __proto__: null } ), a = /(?:Array<)*(?:(\w+)Enum)*\.*(\w+)>*/;
function s( e, t, i ){
var n = a.exec( e.__type );
if( null == n ) throw new Error( "Error at field '" + e.__identifier + "' entity '" + i + "': Invalid type name " + e.__type );
var r = e.__type.startsWith( "Array" ), o = null != n[ 1 ], s = e.__identifier, u = n[ 2 ], l = u;
o && ( u = "Enum" ), r && ( u += "Array" );
var f = e.__value;
null != f && "Point" === u && ( f = { x: f.cx, y: f.cy } ), "PointArray" === u && ( f = f.map( ( function( e ){
return { x: e.cx, y: e.cy }
} ) ) );
var d = { id: s, type: u, value: f };
return o && ( d.ref = t.enumMap[ l ] ), d
}
var u = function(){
function e( e, t, i ){
this.world = e, this.data = t, this.pxOffset = i, this.fields = {};
for( var n = 0; n < t.fieldInstances.length; ++n ){
var r = t.fieldInstances[ n ];
this.fields[ r.__identifier ] = s( r, e, this.id )
}
var o = e.data.defs.entities;
if( null != o ) for( n = 0; n < o.length; ++n ) if( o[ n ].uid === this.data.defUid ){
var a = o[ n ].tilesetId;
null != a && ( this.tileset_ = e.tilesetMap[ a ] )
}
}
return Object.defineProperty( e.prototype, "gridPos", {
get: function(){
return { x: this.data.__grid[ 0 ], y: this.data.__grid[ 1 ] }
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "id", {
get: function(){
return this.data.__identifier
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "pivot", {
get: function(){
return { x: this.data.__pivot[ 0 ], y: this.data.__pivot[ 1 ] }
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "tile", {
get: function(){
return this.data.__tile
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "tileset", {
get: function(){
return this.tileset_
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "pos", {
get: function(){
return { x: this.data.px[ 0 ] + this.pxOffset.x, y: this.data.px[ 1 ] + this.pxOffset.y }
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "relativePos", {
get: function(){
return { x: this.data.px[ 0 ], y: this.data.px[ 1 ] }
}, enumerable: !1, configurable: !0
} ), e
}(), l = function(){
function e( e, t ){
switch( this.world = e, this.data = t, this.autoLayerTiles_ = null, this.entities_ = null, this.gridTiles_ = null, this.intGrid_ = null, this.intGridValues = {}, null != this.data.__tilesetDefUid && ( this.tileset_ = this.world.findTilesetByUid( this.data.__tilesetDefUid ) ), this.type ){
case"AutoLayer":
this.autoLayerTiles_ = t.autoLayerTiles;
break;
case"Entities":
this.entities_ = new Array( t.entityInstances.length );
for( var i = 0; i < t.entityInstances.length; ++i ){
var n = t.entityInstances[ i ];
this.entities_[ i ] = new u( e, n, this.pxTotalOffset )
}
break;
case"Tiles":
this.gridTiles_ = t.gridTiles;
break;
case"IntGrid":
this.intGrid_ = new Array( this.size.width );
t.intGrid = t.intGrid || t.intGridCsv;
for( i = 0; i < t.intGrid.length; ++i ){
n = t.intGrid[ i ];
var r = Math.floor( n.coordId / this.size.width ), o = n.coordId - r * this.size.width;
null == this.intGrid_[ o ] && ( this.intGrid_[ o ] = new Array( this.size.height ) ), this.intGrid_[ o ][ r ] = n.v
}
var a = e.data.defs.layers;
if( null != a ) for( i = 0; i < a.length; ++i ) if( a[ i ].uid === this.uid ) for( var s = 0; s < a[ i ].intGridValues.length; ++s ) this.intGridValues[ s ] = {
color: a[ i ].intGridValues[ s ].color,
id: a[ i ].intGridValues[ s ].identifier
}
}
}
return Object.defineProperty( e.prototype, "size", {
get: function(){
return { width: this.data.__cWid, height: this.data.__cHei }
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "gridSize", {
get: function(){
return this.data.__gridSize
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "opacity", {
get: function(){
return this.data.__opacity
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "pxTotalOffset", {
get: function(){
return { x: this.data.__pxTotalOffsetX, y: this.data.__pxTotalOffsetY }
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "type", {
get: function(){
return this.data.__type
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "autoLayerTiles", {
get: function(){
return this.autoLayerTiles_
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "entities", {
get: function(){
return this.entities_
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "gridTiles", {
get: function(){
return this.gridTiles_
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "intGrid", {
get: function(){
return this.intGrid_
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "level", {
get: function(){
return this.world.findLevelByUid( this.data.levelId )
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "tileset", {
get: function(){
return this.tileset_
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "uid", {
get: function(){
return this.data.layerDefUid
}, enumerable: !1, configurable: !0
} ), e
}(), f = function(){
function e( e ){
this.data = e
}
return Object.defineProperty( e.prototype, "color", {
get: function(){
return this.data.__bgColor
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "pos", {
get: function(){
return this.data.__bgPos
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "pivot", {
get: function(){
return { x: this.data.bgPivotX, y: this.data.bgPivotY }
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "path", {
get: function(){
return this.data.bgRelPath
}, enumerable: !1, configurable: !0
} ), e
}(), d = function(){
function e( e, t ){
if( this.world = e, this.data = t, this.layers = [], this.neighbours_ = null, this.background = new f( t ), null != this.data.layerInstances ) for( var i = 0; i < this.data.layerInstances.length; ++i ) this.layers[ i ] = new l( e, this.data.layerInstances[ i ] )
}
return Object.defineProperty( e.prototype, "id", {
get: function(){
return this.data.identifier
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "size", {
get: function(){
return { width: this.data.pxWid, height: this.data.pxHei }
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "uid", {
get: function(){
return this.data.uid
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "pos", {
get: function(){
return { x: this.data.worldX, y: this.data.worldY }
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "neighbours", {
get: function(){
if( null == this.neighbours_ ){
this.neighbours_ = [];
for( var e = 0; e < this.data.__neighbours.length; ++e ){
var t = this.world.findLevelByUid( this.data.__neighbours[ e ].levelUid );
if( null == t ) throw new Error( "Neighbour '" + this.data.__neighbours[ e ].levelUid + "' for level '" + this.data.identifier + "' does not exist." );
this.neighbours[ e ] = { dir: this.data.__neighbours[ e ].dir, level: t }
}
}
return this.neighbours_
}, enumerable: !1, configurable: !0
} ), e
}(), c = function(){
function e( e, t ){
var i;
this.world = e, this.data = t, this.tileset = null, this.valueMap = {};
for( var n = 0; n < t.values.length; ++n ){
var r = t.values[ n ];
this.valueMap[ r.id ] = {
id: r.id,
tileSrcRect: {
x: r.__tileSrcRect[ 0 ],
y: r.__tileSrcRect[ 1 ],
width: r.__tileSrcRect[ 2 ],
height: r.__tileSrcRect[ 3 ]
}
}
}
this.valueIds = Object.keys( this.valueMap ), this.values = Object.values( this.valueMap ), null != this.data.iconTilesetUid && ( this.tileset = null !== ( i = e.findTilesetByUid( this.data.iconTilesetUid ) ) && void 0 !== i ? i : null )
}
return Object.defineProperty( e.prototype, "id", {
get: function(){
return this.data.identifier
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "uid", {
get: function(){
return this.data.uid
}, enumerable: !1, configurable: !0
} ), e
}(), h = function(){
function e( e, t ){
this.world = e, this.data = t
}
return Object.defineProperty( e.prototype, "id", {
get: function(){
return this.data.identifier
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "padding", {
get: function(){
return this.data.padding
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "size", {
get: function(){
return { width: this.data.pxWid, height: this.data.pxHei }
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "path", {
get: function(){
return this.data.relPath
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "spacing", {
get: function(){
return this.data.spacing
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "gridSize", {
get: function(){
return this.data.tileGridSize
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "uid", {
get: function(){
return this.data.uid
}, enumerable: !1, configurable: !0
} ), e
}(), p = function(){
function e( e ){
this.data = e, this.tilesetMap = {}, this.tilesetIds = [], this.tilesets = [], this.enumMap = {}, this.enumIds = [], this.enums = [];
for( var t = 0; t < e.defs.tilesets.length; ++t ){
var i = e.defs.tilesets[ t ];
this.tilesetMap[ i.identifier ] = new h( this, i )
}
this.tilesetIds = Object.keys( this.tilesetMap ), this.tilesets = Object.values( this.tilesetMap );
for( t = 0; t < e.defs.enums.length; ++t ){
var n = e.defs.enums[ t ];
this.enumMap[ n.identifier ] = new c( this, n )
}
if( this.enumIds = Object.keys( this.enumMap ), this.enums = Object.values( this.enumMap ), this.levelMap = {}, this.levelIds = [], this.levels = [], !e.externalLevels ){
for( t = 0; t < e.levels.length; ++t ) this.levelMap[ e.levels[ t ].identifier ] = new d( this, e.levels[ t ] );
this.levelIds = Object.keys( this.levelMap ), this.levels = Object.values( this.levelMap )
}
}
return e.prototype.findLevel = function( e ){
for( var t = 0; t < this.levels.length; ++t ) if( e( this.levels[ t ] ) ) return this.levels[ t ]
}, e.prototype.findTileset = function( e ){
for( var t = 0; t < this.tilesets.length; ++t ) if( e( this.tilesets[ t ] ) ) return this.tilesets[ t ]
}, e.prototype.findEnum = function( e ){
for( var t = 0; t < this.enums.length; ++t ) if( e( this.enums[ t ] ) ) return this.enums[ t ]
}, e.prototype.findLevelByUid = function( e ){
return this.findLevel( ( function( t ){
return t.uid === e
} ) )
}, e.prototype.findTilesetByUid = function( e ){
return this.findTileset( ( function( t ){
return t.uid === e
} ) )
}, e.prototype.findTilesetByPath = function( e ){
return this.findTileset( ( function( t ){
return t.path === e
} ) )
}, e.prototype.findEnumByUid = function( e ){
return this.findEnum( ( function( t ){
return t.uid === e
} ) )
}, Object.defineProperty( e.prototype, "externalLevels", {
get: function(){
return this.data.externalLevels
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "bgColor", {
get: function(){
return this.data.bgColor
}, enumerable: !1, configurable: !0
} ), Object.defineProperty( e.prototype, "layout", {
get: function(){
return this.data.worldLayout
}, enumerable: !1, configurable: !0
} ), e.prototype.loadLevels = function(){
return t( this, void 0, void 0, ( function(){
var e, t, n, r, o, a = this;
return i( this, ( function( i ){
switch( i.label ){
case 0:
for( e = [], t = this.data.levels, n = function( i ){
var n = t[ i ];
if( null != r.levelMap[ n.identifier ] ) return "continue";
var o = n.externalRelPath;
null != o && e.push( r.fetchLevel( o ).then( ( function( e ){
a.levelMap[ e.id ] = e, a.levelIds[ i ] = e.id, a.levels[ i ] = e
} ) ) )
}, r = this, o = 0; o < t.length; ++o ) n( o );
return [ 4, Promise.all( e ) ];
case 1:
return i.sent(), [ 2 ]
}
} ) )
} ) )
}, e.prototype.loadLevel = function( e ){
return t( this, void 0, void 0, ( function(){
var t, n, r, o;
return i( this, ( function( i ){
switch( i.label ){
case 0:
if( null != this.levelMap[ e ] ) return [ 2 ];
for( t = -1, n = null, r = 0; r < this.data.levels.length; ++r ) if( this.data.levels[ r ].identifier === e ){
n = this.data.levels[ r ], t = r;
break
}
if( null == n ) throw new Error( "Level " + e + " does not exist!" );
return [ 4, this.fetchLevel( n.externalRelPath ) ];
case 1:
return o = i.sent(), this.levelMap[ o.id ] = o, this.levelIds[ t ] = o.id, this.levels[ t ] = o, [ 2 ]
}
} ) )
} ) )
}, e.fromJSON = function( t ){
return new e( t )
}, e.fromURL = function( n ){
return t( this, void 0, void 0, ( function(){
var t;
return i( this, ( function( i ){
switch( i.label ){
case 0:
return t = e.bind, [ 4, r( n ) ];
case 1:
return [ 2, new ( t.apply( e, [ void 0, i.sent() ] ) ) ]
}
} ) )
} ) )
}, e.prototype.fetchLevel = function( e ){
return t( this, void 0, void 0, ( function(){
var t, n;
return i( this, ( function( i ){
switch( i.label ){
case 0:
return t = d.bind, n = [ void 0, this ], [ 4, r( e ) ];
case 1:
return [ 2, new ( t.apply( d, n.concat( [ i.sent() ] ) ) ) ]
}
} ) )
} ) )
}, e.loadRaw = function( e ){
return t( this, void 0, void 0, ( function(){
return i( this, ( function( t ){
switch( t.label ){
case 0:
return [ 4, r( e ) ];
case 1:
return [ 2, t.sent() ]
}
} ) )
} ) )
}, e
}();
e.Background = f, e.Entity = u, e.Enum = c, e.LDtk = o, e.Layer = l, e.Level = d, e.Tileset = h, e.World = p, Object.defineProperty( e, "__esModule", { value: !0 } )
Object.assign(window, e);
} )({});
<!DOCTYPE html>
<html lang="en">
<head>
<style>
body, html {
margin: 0;
padding: 0;
overflow: hidden;
}
</style>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Game v3.0</title>
<script src="lib/engine.all.js"></script>
<script src="lib/ldtk.js"></script>
</head>
<body>
<canvas id="c1" width="1600" height="1024"></canvas>
<script src="lib/gameEngine.js"></script>
<script src="object/Player.js"></script>
<script src="object/Key.js"></script>
<script src="object/NPC.js"></script>
<script src="object/Zone.js"></script>
<script src="js/main.js"></script>
</body>
</html>
\ No newline at end of file
class Key extends GameObject {
step(dt, tfs){
if(this.collide(Player)){
var hole = this.getItem( Zone, { Name: 'Hole' } );
this.startTime = tfs;
hole.animate( 'hideWall', function( progress ){
if(progress === 0){
zzfx(...[1.11,,854,.02,.03,.2,,1.7,,,-131,.06,.01,,,,,.41,.01,.15]);
}
hole.opacity = 1 - progress;
if( hole.opacity < 0.1 ){
hole.visible = false;
}
}, 2 );
}
}
init() {
this.position[1]+=1;
}
draw(){
this.render();
this.debug();
}
}
\ No newline at end of file
class NPC extends GameObject {
step(dt, tfs){
if(this.collide(Player)){
if(!this.saying){
if(this.sentance < this.Dialog.length){
this.say( this.Dialog[ this.sentance ] );
this.sentance++;
}
}
}else{
this.wobble = Math.sin( tfs * 4 ) * 1;
this.wobble2 = Math.sin( tfs * 3+5 ) * 3;
this.position[ 1 ] = this.originalY + 1 + this.wobble | 0;
this.position[ 0 ] = this.originalX + ( this.wobble2 | 0 );
}
}
init() {
if(this.Dialog)
this.sentance = 0;
this.wobble = 0;
this.originalX = this.position[0];
this.originalY = this.position[1];
this.actions = {
openPassage: function() {
var passage = this.getItem(Zone, {Name: 'RocksPassage'});
passage.animate( 'hideThis', function( progress ){
passage.opacity = 1 - progress;
if( passage.opacity < 0.1 ){
passage.visible = false;
}
}, 2 );
}
}
//this.position[1]+=1;
}
draw(dt, tfs){
this.render();
this.sayRender({
place: [-1, -1],
position: [0, 10],
background: '#c7cddd',
border: '#d28d5c',
color: '#7e0404',
padding: [2, 1],
offset: [0, 4]
});
//this.debug();
}
}
\ No newline at end of file
// Класс игрока
class Player extends GameObject {
init(){
this.extendSprite();
this.position[1]++;
this.collisionOffset = [5,8,5,9];
this.xSpeed = 24
this.jumpSpeed = 32
this.onGround = true;
this.yAcceleration = 0;
this.G = 0.98;
//this.DEBUG = true;
this.loadAnimation('stay', {
path: 'sprites/playerStay.png',
size: [32, 64],
frames: 2,
duration: 1
});
this.loadAnimation('walk', {
path: 'sprites/playerWalk.png',
size: [32, 64],
frames: 4,
duration: 1
});
this.loadAnimation('jump', {
path: 'sprites/playerJump.png',
size: [32, 64],
frames: 3,
manual: true,
duration: 1
});
}
step(dt, tfs){
var futureX = this.position[0];
if(Keys.Right){
futureX += dt*this.xSpeed*(Math.sin(tfs*4*3.14)/6+1);
this.tile.f = 0;
this.setAnimation('walk');
}
if(Keys.Left){
futureX -= dt*this.xSpeed*(Math.sin(tfs*4*3.14)/6+1);
this.tile.f = 1;
this.setAnimation('walk');
}
if(!Keys.Left && !Keys.Right){
this.setAnimation('stay');
}
if(!this.wouldCollide([futureX, this.position[1]], ['Level', 'Patches'])){
this.position[0] = futureX;
}
if(Keys.Up){
if(this.onGround){
zzfx(...[1.99,,782,,.22,0,,1.77,,-24,,,,,,,.23]);
//zzfx(...[1.11,,466,.08,,.12,2,1.56,-7.1,,-357,.05,-0.01,,,,.01,.73]); // Random 216 - Mutation 2
this.yAcceleration = this.jumpSpeed;
this.onGround = false;
}
}
this.yAcceleration -= this.G;
while(true){
var futureY = this.position[ 1 ] - this.yAcceleration * dt;
if( !this.wouldCollide( [ this.position[ 0 ], futureY ], [ 'Level', 'Patches' ] ) ){
this.position[ 1 ] = futureY;
this.onGround = false;
var jumpFrame = 1;
if( this.yAcceleration > 10 ){
jumpFrame = 0;
}else if( this.yAcceleration < -8 ){
jumpFrame = 2;
}
this.setAnimation( 'jump', jumpFrame );
break;
}else{
this.yAcceleration *= 0.9;
if(Math.abs(this.yAcceleration)<0.2){
this.onGround = true;
break;
}
}
}
if(this.onGround){
this.yAcceleration = 0;
}
if(Keys.Down){
this.position[1]++;
}
this.updateAnimation(dt);
//this
//this.tile.srcRect[0] = 32*((tfs*4%4)|0);
//this.position[1]+=Math.sin(dt)
Camera.position[0] = this.position[0]+this.width/2;
Camera.position[1] = this.position[1]-this.height/3;
}
onFrameChange(name, frame){
if(name === 'walk'){
if(frame % 2 === 1){
zzfx( ...[ 1.04, , 213, .01, , .02, 1, 2.79, , , , , , .1, , , , .77, .01 ] ); // Blip 155
}
}else if(name === 'jump'){
}
}
draw(){
this.render();
//this.debug();
}
die(){
zzfx(...[,,435,.01,.01,.09,2,1.1,-3.2,,,,,,,,,.87,.1]);
}
}
\ No newline at end of file
// Зона вырезает кусок слоя уровня и даёт возможность показывать и скрывать выбранные участки геометрии уровня
class Zone extends GameObject {
init() {
this.tiles = this.extractTiles();
}
step(dt){
//this.opacity = Math.sin(+new Date()/1000)/2+0.5;
this.terraform(this.tiles, this.visible);
}
draw() {
this.renderTiles(this.tiles);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment