Skip to content

Commit

Permalink
feat(worlds): ✨ Made the world generator WORK AT LAST
Browse files Browse the repository at this point in the history
Now it can without looking crap make levels of a larger size!
  • Loading branch information
Tsunami014 committed Feb 9, 2024
1 parent 6eb2904 commit 621f699
Show file tree
Hide file tree
Showing 6 changed files with 180 additions and 193 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ keys/apiKeys.key
*.json
*.elm
data/worlds/*/*
data/worlds/*/world/backups/*
data/defaultWorld/world/backups/*
4 changes: 2 additions & 2 deletions __main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ def edit(_):
elif element == 1: # make new world
@G.Loading
def NW(self): # TODO: make a GUI screen to ask fr title and description
self.world = World('newworld', 'New World', 'a new world', 25, quality=500)
self.world = World('newworld', 'New World', 'a new world', 10, 100)
cont, res = NW()
if cont:
return self.world(res['world'], True)
return self.world(res['world'], newworld=True)
else:
G.Container.Selection = G.Container.res['worlds'][element.uid-2].name
G.Reload()
Expand Down
28 changes: 18 additions & 10 deletions data/defaultWorld/world.ldtk
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
"imageExportMode": "None",
"exportLevelBg": true,
"pngFilePattern": null,
"backupOnSave": false,
"backupLimit": 10,
"backupOnSave": true,
"backupLimit": 3,
"backupRelPath": null,
"levelNamePattern": "Level_%idx",
"tutorialDesc": "Congrats on finding this!",
"customCommands": [],
"flags": [ "ExportOldTableOfContentData", "IgnoreBackupSuggest" ],
"flags": ["ExportOldTableOfContentData"],
"defs": { "layers": [
{
"__type": "IntGrid",
Expand Down Expand Up @@ -141,7 +141,7 @@
"intGridValuesGroups": [],
"autoRuleGroups": [],
"autoSourceLayerDefUid": null,
"tilesetDefUid": null,
"tilesetDefUid": 26,
"tilePivotX": 0,
"tilePivotY": 0,
"biomeFieldUid": null
Expand Down Expand Up @@ -519,8 +519,8 @@
"embedAtlas": null,
"pxWid": 1024,
"pxHei": 1024,
"tileGridSize": 128,
"spacing": 0,
"tileGridSize": 16,
"spacing": 112,
"padding": 0,
"tags": [],
"tagsSourceEnumUid": null,
Expand All @@ -529,7 +529,7 @@
"savedSelections": [],
"cachedPixelData": {
"opaqueTiles": "1111111111111111111111111111111111111111111111111111111111111111",
"averageColors": "f000f700f770f707f070f007f077f777f700ff00ff70ff07f770f707f777ff77f770ff70fff0ff77f7f0f777f7f7fff7f707ff07ff77ff0ff777f70ff77fff7ff070f770f7f0f777f0f0f077f0f7f7f7f007f707f777f70ff077f00ff07ff77ff077f777f7f7f77ff0f7f07ff0fff7fff777ff77fff7ff7ff7f7f77ff7ffffff"
"averageColors": "f000f800f880f808f080f008f088f888f700ff00ff80ff08f780f708f788ff88f770ff70fff0ff78f7f0f778f7f8fff8f707ff07ff87ff0ff787f70ff78fff8ff070f870f8f0f878f0f0f078f0f8f8f8f007f807f887f80ff087f00ff08ff88ff077f877f8f7f87ff0f7f07ff0fff8fff777ff77fff7ff7ff7f7f77ff7ffffff"
}
}
], "enums": [{ "identifier": "Food", "uid": 10, "values": [ { "id": "Meat", "tileRect": { "tilesetUid": 7, "x": 48, "y": 320, "w": 16, "h": 16 }, "color": 12470831 }, { "id": "Bread", "tileRect": { "tilesetUid": 7, "x": 16, "y": 320, "w": 16, "h": 16 }, "color": 14120515 } ], "iconTilesetUid": 7, "externalRelPath": null, "externalFileChecksum": null, "tags": [] }], "externalEnums": [], "levelFields": [] },
Expand Down Expand Up @@ -708,8 +708,8 @@
"__opacity": 1,
"__pxTotalOffsetX": 0,
"__pxTotalOffsetY": 0,
"__tilesetDefUid": null,
"__tilesetRelPath": null,
"__tilesetDefUid": 26,
"__tilesetRelPath": "images/Colours.png",
"iid": "cce22190-3b70-11ee-849e-c78a24195a27",
"levelId": 0,
"layerDefUid": 2,
Expand All @@ -721,7 +721,15 @@
"autoLayerTiles": [],
"seed": 926674,
"overrideTilesetUid": null,
"gridTiles": [],
"gridTiles": [
{ "px": [336,336], "src": [640,384], "f": 0, "t": 29, "d": [1071], "a": 1 },
{ "px": [272,352], "src": [640,384], "f": 0, "t": 29, "d": [1117], "a": 1 },
{ "px": [288,352], "src": [640,384], "f": 0, "t": 29, "d": [1118], "a": 1 },
{ "px": [304,352], "src": [640,384], "f": 0, "t": 29, "d": [1119], "a": 1 },
{ "px": [320,352], "src": [640,384], "f": 0, "t": 29, "d": [1120], "a": 1 },
{ "px": [256,368], "src": [640,384], "f": 0, "t": 29, "d": [1166], "a": 1 },
{ "px": [272,368], "src": [640,384], "f": 0, "t": 29, "d": [1167], "a": 1 }
],
"entityInstances": []
},
{
Expand Down
2 changes: 1 addition & 1 deletion demos.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def pressed(elm):

def worldsDemo():
from utils import World
World('test', 'Test World', 'A world for testing random stuff', 25, quality=500, override=True)
World('test', 'Test World', 'A world for testing random stuff', 25, override=True)

def terrainGenDemo():
from random import randint
Expand Down
Loading

0 comments on commit 621f699

Please sign in to comment.