diff options
| author | J08nY | 2017-04-24 02:23:37 +0200 |
|---|---|---|
| committer | J08nY | 2017-04-24 02:23:37 +0200 |
| commit | 8f1613ca0fab95fe837d9278e7829f70fb7bc934 (patch) | |
| tree | 572ebdce96d1e1734d5175d646fe2248d483cff2 | |
| parent | cfe4ce0fb4705a6c231528d60e4833c4dc2ec68f (diff) | |
| download | ld38-8f1613ca0fab95fe837d9278e7829f70fb7bc934.tar.gz ld38-8f1613ca0fab95fe837d9278e7829f70fb7bc934.tar.zst ld38-8f1613ca0fab95fe837d9278e7829f70fb7bc934.zip | |
46 files changed, 1067 insertions, 221 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..311b276 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +out/linux/ +out/w64/ diff --git a/.import/triangle.png-81d9911a043b3b982b4bbd30d008317a.stex b/.import/triangle.png-81d9911a043b3b982b4bbd30d008317a.stex Binary files differnew file mode 100644 index 0000000..290358e --- /dev/null +++ b/.import/triangle.png-81d9911a043b3b982b4bbd30d008317a.stex diff --git a/.import/triangles.png-297de53c2012e22e0c9acb69bf5e0414.stex b/.import/triangles.png-297de53c2012e22e0c9acb69bf5e0414.stex Binary files differnew file mode 100644 index 0000000..f16fa85 --- /dev/null +++ b/.import/triangles.png-297de53c2012e22e0c9acb69bf5e0414.stex diff --git a/.import/waves.png-eaf24c5101f895533f4d0df7d131e1c8.stex b/.import/waves.png-eaf24c5101f895533f4d0df7d131e1c8.stex Binary files differnew file mode 100644 index 0000000..81676dd --- /dev/null +++ b/.import/waves.png-eaf24c5101f895533f4d0df7d131e1c8.stex diff --git a/assets/combinator.json b/assets/combinator.json new file mode 100644 index 0000000..b4d41e0 --- /dev/null +++ b/assets/combinator.json @@ -0,0 +1,20 @@ +{ + "bases": [ + "Great, you have succesfully created a new planet! It has a mass of /mass/, it is mainly /type/.", + "Your new creation is ready master! A planet was created as you commanded. /mass_comment/ /type_comment/" + ], + "mass_comment": { + "very_small": "It's so tiny it's largest mountain almost covers it.", + "small": "A rather small planet.", + "medium": "", + "big": "", + "huge": "", + "yuge": "It is so YUGE! Something else must be small... Look at those hands. Are they small hands? And he referred to my hands, if they are small, something else must be small." + }, + "type_comment": { + "solid": "It is clearly solid, with a metallic core.", + "rock": "A rocky planet, like this one shouldn't get lost anywhere.", + "icy": "Consists largely of ice, which being a solid form of water, gives good chances to CHON based life forms.", + "gaseous": "Gaseous." + } +} diff --git a/assets/events.json b/assets/events.json new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/assets/events.json diff --git a/assets/howto.json b/assets/howto.json new file mode 100644 index 0000000..5705c81 --- /dev/null +++ b/assets/howto.json @@ -0,0 +1,10 @@ +{ + "title": "How it's Made: Planets", + "text": "The ultimate guide for any beginner but also experienced planet builder!\ +Covers all the bases, even the orthonormal ones.\ +\ +You definitely need some solid base, to create the planet's core, mantle and crust. If you want to have a chance at creating life, gaseous elements for your planet's atmosphere are a must have! You could also try to create a gaseous planet, or anything else really, if spaghetti monsters are your thing.\ +\ +Buy resources from the Multiverse shop, they have everything you will need to make a planet. Usually sold in batches of sextillion tons. +" +} diff --git a/assets/incubator.json b/assets/incubator.json new file mode 100644 index 0000000..568c1e8 --- /dev/null +++ b/assets/incubator.json @@ -0,0 +1,20 @@ +{ +"bases": [ + "" +] + +"misc": { + "schrodinger": [ + "Life on this planet possesses a weird property, even by Multiverse standards. It seems to be in a state between existing and not existing.", + "Cardboard boxes are a common occurence on this planet, everything seems to have them on. Oh god, even the molecules are in cardboard boxes!", + "" + ], + "trees": [ + "This planet is covered in trees full of solid rocket fuel. They grow to maturity, producing solid fuel in their trunks. When mature, they shed their branches apart from a few top, seed-bearing, ones and lift off, to seek another planet.", + "The smell of rocket fuel is very strong at the surface of the planet. It feels like it's evaporating from the trees.", + "" + ] +}, + + +} diff --git a/assets/life.json b/assets/life.json new file mode 100644 index 0000000..568c1e8 --- /dev/null +++ b/assets/life.json @@ -0,0 +1,20 @@ +{ +"bases": [ + "" +] + +"misc": { + "schrodinger": [ + "Life on this planet possesses a weird property, even by Multiverse standards. It seems to be in a state between existing and not existing.", + "Cardboard boxes are a common occurence on this planet, everything seems to have them on. Oh god, even the molecules are in cardboard boxes!", + "" + ], + "trees": [ + "This planet is covered in trees full of solid rocket fuel. They grow to maturity, producing solid fuel in their trunks. When mature, they shed their branches apart from a few top, seed-bearing, ones and lift off, to seek another planet.", + "The smell of rocket fuel is very strong at the surface of the planet. It feels like it's evaporating from the trees.", + "" + ] +}, + + +} diff --git a/assets/shop.json b/assets/shop.json index b50ee24..241bbd1 100644 --- a/assets/shop.json +++ b/assets/shop.json @@ -1,35 +1,103 @@ { - "1": [ + "solid": [ {"id": "low_planet_mat", "name": "Low-grade planetary material", "desc": "Buying this, you basically get bread crumbs from other recycled worlds.", - "cost": 10}, + "cost": 10, + "mass": 0.2, + "color": "#222034"}, {"id": "mid_planet_mat", "name": "Middle-grade planetary material", "desc": "While still recycled, it's previous owners didn't filter out all the good stuff.", - "cost": 30}, + "cost": 30, + "mass": 0.3, + "color": "#181910"}, {"id": "high_planet_mat", "name": "High-grade planetary material", "desc": "Made from worlds demolished to make way for a new hyperspatial express drive.", - "cost": 50}, + "cost": 50, + "mass": 0.4, + "color": "#151731"}, {"id": "top_planet_mat", "name": "Pristine planetary material", "desc": "Pretty much the only source of such high-quality planetary material comes from the underground. ", - "cost": 100}, + "cost": 100, + "mass": 0.5, + "color": "#321521"}, + {"id": "high_rad_mat", + "name": "Ionizing planetary material", + "desc": "", + "cost": 140, + "mass": 0.4, + "color": "#99e550"}, {"id": "low_inter_dust", "name": "Low-grade interplanetary dust", "desc": "Scraped of the bottom of some junkyard universe megaship, this really doesn't have much to offer.", - "cost": 20}, + "cost": 20, + "mass":0.3, + "color": "#323c39"}, {"id": "middle_inter_dust", "name": "Middle-grade interplanetary dust", "desc": "", - "cost": 40}, + "cost": 40, + "mass":0.4, + "color": "#3c3031"}, {"id": "high_inter_dust", "name": "High-grade interplanetary dust", - "desc": "Collected after a supernova, it contains many diverse elements.", - "cost": 80} + "desc": "Collected after a supernova, it contains many diverse solid and gaseous elements.", + "cost": 80, + "mass":0.5, + "color": "#453832"} ], - "2": [ + "gas": [ + {"id": "hydrogen", + "name": "Hydrogen", + "desc": "The most abundant element across the multi-verse, you can get it cheap.", + "cost": 5, + "mass": 0.1, + "volume": 1, + "color": "#202030"}, + {"id": "helium", + "name": "Helium", + "desc": "", + "cost": 10, + "mass": 0.1, + "volume": 1, + "color": "#202030"}, + {"id": "alpha_chlerixum", + "name": "Alpha Chlerixum", + "desc": "", + "cost": 15, + "mass": 0.1, + "volume": 1, + "color": "#451917"}, + {"id": "bllenerium", + "name": "Bllenerium", + "desc": "Extremely dense for a gas, in some universes it will definitely be considered a liquid.", + "cost": 20, + "mass": 0.5, + "volume": 1, + "color": "#101557"}, + {"id": "kataraxen", + "name": "Kataraxen", + "desc": "", + "cost": 25, + "mass": 0.1, + "volume": 1, + "color": "#075721"}, + {"id": "mystery_balloon", + "name": "Mystery balloon", + "desc": "It's just a small balloon, yet it is supposed to contain enough gases to fill out a whole planet's atmosphere?", + "cost": 30, + "mass": 0.1, + "volume": 1, + "color": "#152030"} + ], + "precursor": [ + {"id": "space_junk", + "name": "Space junk", + "desc": "", + "cost": 50}, {"id": "unknown_molecules", "name": "Unknown molecules", "desc": "The packaging looks leaky and the guarantee signs are all weird but you might take it for the price.", @@ -51,10 +119,10 @@ "desc": "", "cost": 500} ], - "3": [ + "life": [ {"id": "chon_life_1", "name": "CHON based life (level 1)", - "desc": "", + "desc": "The most common life forms among the multi-verse are CHON based, so you can get them in bulk.", "cost": 1000}, {"id": "chon_life_2", "name": "CHON based life (level 2)", @@ -64,17 +132,32 @@ "name": "Grey goo", "desc": "No one really told you what it is, they just sell it.", "cost": 2000}, + {"id": "plumbus", + "name": "Plumbus", + "desc": "Everyone has a plumbus in their home.\ +First they take the dingle bop and they smooth it out with a bunch of schleem.\ +The schleem is then repurposed for later batches.\ +They take the dingle bop and they push it through the grumbo, where the fleeb is rubbed against it.\ +It's important that the fleeb is rubbed, becasue the fleeb has all the fleeb juice.\ +Then, a schlami shows up, and he rubs it and spits on it.\ +They cut the fleeb. There's several hizzards in the way.\ +The blamfs rub against the chumbles, and the plubis, and grumbo are shaved away.\ +That leaves you with a regular old plumbus.", + "cost": 2500}, {"id": "cardboard_box", "name": "A cardboard box", "desc": "You might have heard some cat noises from the inside, although you can't be sure unless you open it.", - "cost": 3000} - ], - "other": [ - {"id": "planets_howto", - "name": "How it's Made: Planets", - "desc": "The ultimate guide for any beginner but also experienced planet builder!\ - Covers all the bases, even the orthonormal ones.", - "cost": 5} + "cost": 3000}, + {"id": "stage_trees", + "name": "A forest of weird trees", + "desc": "They seem oddly rocket shaped. They even have the inter-civilized safety markings.", + "cost": 3000}, + {"id": "spaghetti_monster", + "name": "A flying spaghetti monster", + "desc": "Hovering with barely audible noises of slurping sauce you are not even sure how it's legal to trade such a creature.", + "cost": 3500} ] } + + diff --git a/assets/triangle.png b/assets/triangle.png Binary files differnew file mode 100644 index 0000000..3127458 --- /dev/null +++ b/assets/triangle.png diff --git a/assets/triangle.png.import b/assets/triangle.png.import new file mode 100644 index 0000000..05bbde8 --- /dev/null +++ b/assets/triangle.png.import @@ -0,0 +1,20 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/triangle.png-81d9911a043b3b982b4bbd30d008317a.stex" + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=true +stream=false +size_limit=0 +detect_3d=true diff --git a/assets/triangle.svg b/assets/triangle.svg new file mode 100644 index 0000000..d09bc34 --- /dev/null +++ b/assets/triangle.svg @@ -0,0 +1,108 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="129mm" + height="129mm" + viewBox="0 0 129 129" + version="1.1" + id="svg5766" + inkscape:version="0.92.1 r15371" + sodipodi:docname="triangle.svg"> + <defs + id="defs5760" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.7" + inkscape:cx="29.298907" + inkscape:cy="276.36848" + inkscape:document-units="mm" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1366" + inkscape:window-height="732" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" /> + <metadata + id="metadata5763"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-168)"> + <path + sodipodi:type="star" + style="fill:none;fill-opacity:1;stroke:#fffff2;stroke-width:12.01102734;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path6329-6" + sodipodi:sides="3" + sodipodi:cx="33.639879" + sodipodi:cy="199.61686" + sodipodi:r1="18.874472" + sodipodi:r2="22.526917" + sodipodi:arg1="1.5707964" + sodipodi:arg2="2.6179939" + inkscape:flatsided="true" + inkscape:rounded="0" + inkscape:randomized="0" + d="m 33.639876,218.49134 -16.34577,-28.31171 32.691544,0 z" + inkscape:transform-center-x="-0.45499767" + inkscape:transform-center-y="-10.867117" /> + <path + sodipodi:type="star" + style="fill:none;fill-opacity:1;stroke:#fffff2;stroke-width:12.01102734;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path6329-6-5" + sodipodi:sides="3" + sodipodi:cx="92.982138" + sodipodi:cy="199.69827" + sodipodi:r1="18.874472" + sodipodi:r2="22.526918" + sodipodi:arg1="1.5707964" + sodipodi:arg2="2.6179939" + inkscape:flatsided="true" + inkscape:rounded="0" + inkscape:randomized="0" + d="m 92.982138,218.57274 -16.34577,-28.3117 32.691542,0 z" + inkscape:transform-center-x="-0.45499767" + inkscape:transform-center-y="-10.867117" /> + <path + sodipodi:type="star" + style="fill:none;fill-opacity:1;stroke:#fffff2;stroke-width:12.01102734;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path6329-6-3" + sodipodi:sides="3" + sodipodi:cx="63.122019" + sodipodi:cy="253.74887" + sodipodi:r1="18.874472" + sodipodi:r2="22.526918" + sodipodi:arg1="1.5707964" + sodipodi:arg2="2.6179939" + inkscape:flatsided="true" + inkscape:rounded="0" + inkscape:randomized="0" + d="m 63.122019,272.62334 -16.34577,-28.31171 32.691544,1e-5 z" + inkscape:transform-center-x="-0.45499767" + inkscape:transform-center-y="-10.867117" /> + </g> +</svg> diff --git a/assets/triangles.png b/assets/triangles.png Binary files differnew file mode 100644 index 0000000..1b1829d --- /dev/null +++ b/assets/triangles.png diff --git a/assets/triangles.png.import b/assets/triangles.png.import new file mode 100644 index 0000000..d8872a2 --- /dev/null +++ b/assets/triangles.png.import @@ -0,0 +1,20 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/triangles.png-297de53c2012e22e0c9acb69bf5e0414.stex" + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=true +stream=false +size_limit=0 +detect_3d=true diff --git a/assets/triangles.svg b/assets/triangles.svg new file mode 100644 index 0000000..ce0edb5 --- /dev/null +++ b/assets/triangles.svg @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + id="svg5766" + version="1.1" + viewBox="0 0 129 129" + height="129mm" + width="129mm"> + <defs + id="defs5760" /> + <metadata + id="metadata5763"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + transform="translate(0,-168)" + id="layer1"> + <path + d="m 33.639876,218.49134 -16.34577,-28.31171 32.691544,0 z" + id="path6329-6" + style="fill:none;fill-opacity:1;stroke:#fffff2;stroke-width:12.01102734;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <path + d="m 92.982138,218.57274 -16.34577,-28.3117 32.691542,0 z" + id="path6329-6-5" + style="fill:none;fill-opacity:1;stroke:#fffff2;stroke-width:12.01102734;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <path + d="m 63.122019,272.62334 -16.34577,-28.31171 32.691544,1e-5 z" + id="path6329-6-3" + style="fill:none;fill-opacity:1;stroke:#fffff2;stroke-width:12.01102734;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + </g> +</svg> diff --git a/assets/waves.png b/assets/waves.png Binary files differnew file mode 100644 index 0000000..4587446 --- /dev/null +++ b/assets/waves.png diff --git a/assets/waves.png.import b/assets/waves.png.import new file mode 100644 index 0000000..d34ace5 --- /dev/null +++ b/assets/waves.png.import @@ -0,0 +1,20 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/waves.png-eaf24c5101f895533f4d0df7d131e1c8.stex" + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=true +stream=false +size_limit=0 +detect_3d=true diff --git a/assets/waves.svg b/assets/waves.svg new file mode 100644 index 0000000..087c11e --- /dev/null +++ b/assets/waves.svg @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="129mm" + height="129mm" + viewBox="0 0 129 129" + version="1.1" + id="svg5092" + inkscape:version="0.92.1 r15371" + sodipodi:docname="waves.svg"> + <defs + id="defs5086" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.98994949" + inkscape:cx="287.66805" + inkscape:cy="236.96867" + inkscape:document-units="mm" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1366" + inkscape:window-height="732" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" /> + <metadata + id="metadata5089"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-168)"> + <path + style="fill:#000000;fill-opacity:1;stroke:#fffff6;stroke-width:14.30486584;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path5724" + d="m 15.660399,207.47209 c 0.04194,-0.0738 0.08698,-0.14386 0.130163,-0.21649 0.07513,-0.12859 0.131511,-0.27065 0.192922,-0.40889 0.08675,-0.20526 0.177759,-0.40779 0.265255,-0.61261 0.112891,-0.26912 0.226854,-0.53757 0.340903,-0.80598 0.143079,-0.3325 0.288249,-0.66371 0.437292,-0.99242 0.178259,-0.40348 0.367201,-0.79975 0.559,-1.19415 0.227769,-0.47086 0.46454,-0.93538 0.702065,-1.3992 0.274356,-0.53423 0.560811,-1.05938 0.848099,-1.58371 0.31617,-0.57939 0.647697,-1.14635 0.984205,-1.70894 0.364781,-0.60895 0.742162,-1.20689 1.126323,-1.79844 0.405508,-0.62364 0.826888,-1.23202 1.25148,-1.83701 0.428513,-0.61241 0.868698,-1.21281 1.310114,-1.81182 0.43851,-0.59532 0.893967,-1.17207 1.357486,-1.73934 0.45859,-0.55984 0.931553,-1.10226 1.410856,-1.63646 0.468656,-0.52899 0.959999,-1.02757 1.459534,-1.51384 0.492,-0.47696 1.002263,-0.92532 1.522623,-1.3565 0.512824,-0.42204 1.048825,-0.80082 1.592389,-1.1625 0.543841,-0.36294 1.110506,-0.67132 1.682054,-0.96514 0.58588,-0.29843 1.189913,-0.54041 1.796666,-0.76933 1.83761,-0.63655 3.677231,-1.29047 5.559114,-1.70826 0.645305,-0.14819 1.298843,-0.22889 1.952748,-0.29726 0.664929,-0.0645 1.332512,-0.0739 1.999232,-0.0653 0.6822,0.0155 1.361533,0.089 2.038533,0.18647 0.69997,0.10012 1.392475,0.257 2.082004,0.4301 0.714189,0.18075 1.420152,0.40361 2.121678,0.64441 0.723393,0.2491 1.434217,0.54612 2.140318,0.85745 0.725792,0.32017 1.440995,0.67262 2.148478,1.04668 0.715534,0.38038 1.420063,0.78907 2.118476,1.21241 0.705567,0.42241 1.393648,0.88368 2.072565,1.36415 0.677267,0.48163 1.339132,0.99361 1.988696,1.52701 0.658831,0.53157 1.290846,1.10689 1.915122,1.69459 0.642503,0.61392 1.260046,1.26371 1.867871,1.92596 0.620041,0.68115 1.219276,1.38844 1.812073,2.1033 0.600052,0.71905 1.191097,1.44847 1.773666,2.18781 0.584412,0.73561 1.157887,1.48344 1.730061,2.23266 0.570508,0.74624 1.135263,1.49874 1.69346,2.25818 0.558865,0.75761 1.110116,1.52318 1.659976,2.29015 0.540891,0.74885 1.075754,1.50396 1.612246,2.25729 0.516047,0.72745 1.036825,1.45 1.558136,2.172 0.507381,0.70808 1.0225,1.40807 1.544369,2.1008 0.499907,0.67267 1.009688,1.33462 1.52249,1.99314 0.491485,0.6283 0.988616,1.25028 1.494679,1.86174 0.484516,0.58514 0.980999,1.15567 1.489803,1.71038 0.491651,0.53767 1.006097,1.04408 1.52646,1.54105 0.504346,0.48232 1.03295,0.92518 1.567493,1.35751 0.515609,0.41641 1.05127,0.7948 1.594403,1.15683 0.525902,0.34674 1.063182,0.66794 1.610346,0.96352 0.532596,0.28746 1.07985,0.53181 1.634849,0.74892 0.543361,0.20535 1.098554,0.35982 1.660264,0.47175 0.566179,0.10707 1.138961,0.12652 1.71083,0.11009 0.58786,-0.0167 1.168967,-0.122 1.742166,-0.27302 1.295423,-0.40264 3.223367,-0.99935 -2.802924,0.88959 -0.0996,0.0314 0.197956,-0.0679 0.296398,-0.10434 0.269045,-0.0989 0.325583,-0.12562 0.592116,-0.23668 0.603944,-0.2594 1.187463,-0.57967 1.763914,-0.91556 0.579781,-0.33975 1.144739,-0.71392 1.703566,-1.10037 0.546464,-0.38246 1.083908,-0.78297 1.61637,-1.19267 0.516792,-0.39792 1.024281,-0.81265 1.528177,-1.23347 0.48348,-0.4053 0.95929,-0.82339 1.43094,-1.24814 0.4594,-0.41239 0.90597,-0.8446 1.34817,-1.28296 0.43221,-0.42756 0.85105,-0.87371 1.26447,-1.32699 0.40114,-0.44154 0.78723,-0.90211 1.16465,-1.37257 0.36708,-0.459 0.7254,-0.92789 1.08427,-1.39606 0.34405,-0.44485 0.67821,-0.90038 1.01405,-1.35406 0,0 3.82933,-0.74387 3.82933,-0.74387 v 0 c -0.33904,0.45423 -0.67324,0.91366 -1.01768,1.36206 -0.36055,0.46983 -0.71925,0.9418 -1.08626,1.40434 -0.37673,0.48029 -0.76113,0.95189 -1.16303,1.40223 -0.4121,0.46267 -0.83155,0.91588 -1.264,1.35118 -0.44204,0.44551 -0.88864,0.88463 -1.34707,1.30584 -0.47327,0.42869 -0.94814,0.85485 -1.43314,1.26447 -0.50435,0.4268 -1.01242,0.84731 -1.52966,1.25153 -0.53324,0.41528 -1.07004,0.82388 -1.6167,1.21353 -0.55806,0.39592 -1.121813,0.78076 -1.700518,1.1321 -0.575375,0.34766 -1.155925,0.68374 -1.756279,0.9659 -1.766483,0.80641 -3.616716,1.32408 -5.461414,1.80915 -0.586056,0.12068 -1.177543,0.20168 -1.773302,0.19391 -0.583034,-0.0109 -1.166086,-0.0537 -1.73934,-0.19002 -0.567971,-0.13876 -1.1311,-0.30699 -1.679334,-0.53459 -0.558124,-0.23625 -1.1098,-0.49445 -1.645927,-0.79599 -0.548668,-0.31122 -1.090155,-0.64065 -1.617994,-1.00027 -0.545609,-0.37518 -1.083382,-0.7669 -1.601617,-1.19477 -0.537585,-0.44289 -1.06616,-0.90142 -1.573638,-1.39316 -0.522793,-0.50618 -1.03762,-1.02443 -1.531331,-1.57129 -0.508652,-0.5639 -1.006556,-1.14151 -1.492126,-1.73401 -0.50422,-0.61787 -1.002102,-1.24316 -1.492871,-1.87643 -0.511419,-0.66205 -1.019644,-1.32761 -1.519646,-2.00212 -0.520895,-0.69675 -1.034542,-1.40114 -1.543357,-2.11058 -0.521087,-0.72287 -1.040741,-1.44725 -1.555446,-2.17668 -0.534246,-0.75389 -1.068232,-1.50807 -1.607444,-2.25687 -0.549084,-0.76524 -1.099308,-1.5294 -1.658264,-2.28435 -0.558295,-0.75579 -1.120832,-1.50705 -1.690589,-2.25047 -0.571476,-0.74678 -1.144626,-1.49172 -1.727779,-2.22546 -0.582789,-0.7346 -1.172558,-1.46103 -1.771771,-2.17642 -0.590508,-0.7082 -1.188663,-1.40742 -1.80797,-2.07965 -0.605981,-0.65209 -1.221632,-1.29172 -1.863626,-1.89278 -0.622221,-0.57784 -1.254899,-1.13899 -1.908763,-1.6648 -0.648557,-0.52128 -1.306467,-1.02606 -1.980911,-1.49819 -0.676485,-0.47084 -1.36329,-0.91974 -2.06438,-1.33608 -0.696491,-0.41559 -1.399378,-0.81591 -2.112823,-1.18821 -0.7062,-0.36352 -1.419218,-0.70764 -2.142853,-1.01851 -0.703496,-0.30139 -1.412288,-0.58607 -2.132863,-0.82376 -0.700164,-0.22821 -1.403603,-0.44275 -2.115709,-0.61133 -0.686714,-0.1612 -1.376785,-0.30263 -2.07312,-0.39007 -0.673063,-0.0824 -1.348536,-0.1403 -2.025534,-0.13877 -0.662931,0.005 -1.326349,0.0262 -1.986286,0.10751 -0.650386,0.0799 -1.299066,0.18117 -1.939679,0.34062 -0.293419,0.0731 -0.338924,0.0822 -0.630551,0.16448 -0.104405,0.0296 -0.416253,0.12471 -0.312649,0.0913 6.00768,-1.9328 4.047456,-1.29273 2.753152,-0.87776 -0.606407,0.21494 -1.209434,0.44572 -1.798216,0.72327 -0.571891,0.27876 -1.139693,0.57167 -1.685619,0.91844 -0.545303,0.3464 -1.083106,0.71068 -1.598549,1.11825 -0.524603,0.41473 -1.03523,0.85373 -1.529381,1.31931 -0.500916,0.47577 -0.995677,0.96161 -1.46528,1.48171 -0.478903,0.52966 -0.955995,1.06173 -1.415152,1.61618 -0.46405,0.55987 -0.922025,1.12706 -1.361307,1.71516 -0.441882,0.59537 -0.882652,1.19207 -1.312057,1.80044 -0.422766,0.60038 -0.845811,1.20065 -1.249345,1.81992 -0.38391,0.58369 -0.759734,1.175 -1.122077,1.77822 -0.334444,0.55621 -0.66603,1.11516 -0.979118,1.68909 -0.286212,0.51719 -0.565666,1.03991 -0.84001,1.56619 -0.234362,0.45884 -0.466254,0.91957 -0.692112,1.3845 -0.186141,0.39042 -0.377423,0.77739 -0.54985,1.17694 -0.143728,0.32687 -0.290889,0.65161 -0.428642,0.98226 -0.11413,0.26435 -0.224033,0.53137 -0.331663,0.7996 -0.08396,0.20451 -0.166434,0.40963 -0.256537,0.61034 -0.05821,0.14803 -0.121174,0.29304 -0.177627,0.44195 -0.03604,0.0848 -0.07363,0.16791 -0.120646,0.24472 0,0 -3.890254,0.81527 -3.890254,0.81527 z" + inkscape:connector-curvature="0" /> + <path + style="fill:#000000;fill-opacity:1;stroke:#fffff6;stroke-width:14.30486584;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path5724-3" + d="m 15.285766,264.16138 c 0.04195,-0.0737 0.08698,-0.14385 0.130164,-0.21647 0.07513,-0.12861 0.13151,-0.27066 0.192921,-0.40889 0.08675,-0.20525 0.177759,-0.40781 0.265256,-0.61262 0.11289,-0.26912 0.226854,-0.53757 0.340902,-0.80599 0.14308,-0.33249 0.288249,-0.6637 0.437292,-0.99241 0.178259,-0.40349 0.367201,-0.79976 0.559001,-1.19415 0.22777,-0.47086 0.464541,-0.93538 0.702065,-1.39919 0.274355,-0.53423 0.56081,-1.05939 0.848097,-1.58371 0.31617,-0.57939 0.647699,-1.14637 0.984205,-1.70896 0.364782,-0.60895 0.742163,-1.20688 1.126324,-1.79843 0.405509,-0.62363 0.826888,-1.23203 1.25148,-1.83701 0.428515,-0.61242 0.868698,-1.21281 1.310115,-1.81183 0.43851,-0.59532 0.893965,-1.17206 1.357486,-1.73934 0.458589,-0.55983 0.931551,-1.10225 1.410855,-1.63645 0.468656,-0.52899 0.959999,-1.02757 1.459533,-1.51385 0.492002,-0.47696 1.002263,-0.92532 1.522624,-1.3565 0.512823,-0.42204 1.048825,-0.8008 1.592391,-1.1625 0.543839,-0.36294 1.110504,-0.67131 1.682053,-0.96513 0.58588,-0.29843 1.189913,-0.54041 1.796665,-0.76934 1.837609,-0.63654 3.67723,-1.29046 5.559116,-1.70825 0.645302,-0.1482 1.298841,-0.22889 1.952746,-0.29726 0.66493,-0.0645 1.332512,-0.0739 1.999231,-0.0653 0.682201,0.0155 1.361532,0.089 2.038534,0.18647 0.69997,0.10012 1.392475,0.257 2.082005,0.43009 0.714189,0.18077 1.42015,0.40362 2.121678,0.64444 0.723391,0.24907 1.434216,0.54611 2.140316,0.85743 0.725793,0.32017 1.440998,0.67261 2.148477,1.04668 0.715536,0.3804 1.420066,0.78909 2.118479,1.21241 0.705567,0.42241 1.393648,0.88368 2.072563,1.36415 0.677269,0.48163 1.339134,0.99362 1.988697,1.527 0.658831,0.53157 1.290846,1.10689 1.915121,1.6946 0.642503,0.61392 1.260049,1.26371 1.867872,1.92596 0.620044,0.68115 1.219275,1.38845 1.812072,2.1033 0.600055,0.71904 1.191098,1.44846 1.773667,2.18781 0.584411,0.73561 1.157887,1.48344 1.730063,2.23266 0.570507,0.74624 1.135261,1.49874 1.693458,2.25819 0.558867,0.7576 1.110119,1.52317 1.659975,2.29014 0.540894,0.74884 1.075755,1.50395 1.612246,2.25728 0.51605,0.72745 1.036825,1.45003 1.558137,2.17202 0.507382,0.70809 1.022501,1.40805 1.54437,2.10079 0.499907,0.67268 1.009689,1.33461 1.522487,1.99314 0.491488,0.6283 0.988618,1.25029 1.494681,1.86175 0.484516,0.58515 0.981001,1.15567 1.489804,1.71036 0.491648,0.53768 1.006095,1.04408 1.526459,1.54107 0.504348,0.48231 1.032951,0.92518 1.567494,1.35749 0.515611,0.41643 1.051277,0.79481 1.594397,1.15685 0.525903,0.34676 1.063188,0.66794 1.610349,0.9635 0.532597,0.28747 1.079853,0.53183 1.634853,0.74893 0.543364,0.20535 1.098554,0.35981 1.660258,0.47175 0.566179,0.10708 1.138968,0.12652 1.710833,0.11008 0.587862,-0.0167 1.168967,-0.12197 1.742167,-0.27301 1.295428,-0.40263 3.223374,-0.99935 -2.802927,0.88961 -0.0996,0.0314 0.197966,-0.0679 0.296403,-0.10435 0.269046,-0.0989 0.325582,-0.12563 0.592115,-0.23666 0.603942,-0.2594 1.187465,-0.57969 1.763913,-0.91557 0.579778,-0.33977 1.144738,-0.71393 1.703567,-1.10038 0.546461,-0.38247 1.083905,-0.78295 1.616375,-1.19267 0.516791,-0.39791 1.024281,-0.81265 1.528174,-1.23345 0.48347,-0.40532 0.95929,-0.82341 1.43093,-1.24815 0.4594,-0.41241 0.90598,-0.84461 1.34818,-1.28297 0.43221,-0.42755 0.85104,-0.87372 1.26447,-1.32698 0.40113,-0.44155 0.78722,-0.90211 1.16465,-1.37257 0.36709,-0.45901 0.7254,-0.92788 1.08427,-1.39605 0.34406,-0.44486 0.67821,-0.90037 1.01406,-1.35407 0,0 3.82932,-0.74387 3.82932,-0.74387 v 0 c -0.33904,0.45423 -0.67324,0.91364 -1.01769,1.36206 -0.36054,0.46983 -0.71924,0.9418 -1.08626,1.40435 -0.37672,0.48028 -0.76113,0.95187 -1.16301,1.40222 -0.41212,0.46267 -0.83156,0.91588 -1.26402,1.35118 -0.44203,0.4455 -0.88863,0.88464 -1.34706,1.30583 -0.47328,0.42869 -0.94815,0.85485 -1.43314,1.26448 -0.50435,0.4268 -1.01242,0.84729 -1.52966,1.25152 -0.53323,0.41528 -1.07004,0.82389 -1.6167,1.21353 -0.55806,0.39592 -1.121813,0.78077 -1.700521,1.13211 -0.575377,0.34766 -1.155918,0.68373 -1.756275,0.96589 -1.766491,0.80642 -3.616716,1.32409 -5.461414,1.80916 -0.586059,0.12068 -1.177547,0.20167 -1.773302,0.1939 -0.583033,-0.0109 -1.166091,-0.0535 -1.739345,-0.19002 -0.567963,-0.13876 -1.131098,-0.30698 -1.679331,-0.53459 -0.558125,-0.23623 -1.109801,-0.49444 -1.645928,-0.79599 -0.54867,-0.31123 -1.090155,-0.64062 -1.617995,-1.00024 -0.545608,-0.37522 -1.083382,-0.76693 -1.601616,-1.1948 -0.537586,-0.44289 -1.06616,-0.90143 -1.573639,-1.39316 -0.522792,-0.50619 -1.037619,-1.02442 -1.531332,-1.57129 -0.50865,-0.5639 -1.006555,-1.1415 -1.492122,-1.73401 -0.504224,-0.61786 -1.002106,-1.24315 -1.492874,-1.87642 -0.511419,-0.66204 -1.019643,-1.3276 -1.519644,-2.00212 -0.520898,-0.69674 -1.034544,-1.40114 -1.543358,-2.11059 -0.521089,-0.72287 -1.040742,-1.44726 -1.555447,-2.17669 -0.534244,-0.75388 -1.06823,-1.50806 -1.607445,-2.25685 -0.549083,-0.76526 -1.099307,-1.5294 -1.658263,-2.28437 -0.558295,-0.75577 -1.120832,-1.50704 -1.690586,-2.25046 -0.57148,-0.74676 -1.144627,-1.49172 -1.727782,-2.22546 -0.582788,-0.73461 -1.172557,-1.46102 -1.771773,-2.17641 -0.590506,-0.7082 -1.188661,-1.40744 -1.807968,-2.07967 -0.605982,-0.65208 -1.221633,-1.29171 -1.863626,-1.89277 -0.622221,-0.57784 -1.254898,-1.139 -1.908765,-1.6648 -0.648554,-0.52128 -1.306466,-1.02605 -1.980911,-1.49817 -0.676485,-0.47086 -1.363286,-0.91977 -2.064375,-1.3361 -0.696493,-0.41559 -1.399381,-0.81592 -2.112826,-1.18821 -0.706199,-0.36352 -1.419217,-0.70763 -2.142852,-1.0185 -0.703497,-0.3014 -1.412289,-0.58607 -2.132865,-0.82378 -0.700163,-0.2282 -1.403603,-0.44275 -2.115708,-0.61132 -0.686715,-0.16118 -1.376787,-0.30264 -2.07312,-0.39007 -0.673062,-0.0824 -1.348534,-0.14029 -2.025533,-0.13877 -0.662933,0.005 -1.326351,0.0262 -1.986285,0.10751 -0.650387,0.0799 -1.299068,0.18118 -1.939679,0.34061 -0.293419,0.0731 -0.338927,0.0822 -0.630553,0.16449 -0.104405,0.0296 -0.416252,0.12471 -0.31265,0.0913 6.007683,-1.9328 4.047457,-1.29272 2.753152,-0.87775 -0.606407,0.21493 -1.209433,0.44571 -1.798215,0.72325 -0.571892,0.27877 -1.139691,0.57167 -1.68562,0.91844 -0.545302,0.34641 -1.083105,0.71069 -1.598549,1.11827 -0.524601,0.41473 -1.035228,0.85371 -1.529381,1.3193 -0.500914,0.47576 -0.995676,0.96161 -1.465279,1.48171 -0.478901,0.52966 -0.955994,1.06173 -1.415151,1.61618 -0.46405,0.55987 -0.922025,1.12707 -1.361309,1.71516 -0.44188,0.59538 -0.882652,1.19208 -1.312055,1.80046 -0.422768,0.60035 -0.845812,1.20062 -1.249345,1.8199 -0.383911,0.5837 -0.759735,1.17499 -1.122078,1.77823 -0.334444,0.55619 -0.66603,1.11516 -0.979117,1.68909 -0.286213,0.51719 -0.565667,1.0399 -0.840012,1.56619 -0.23436,0.45883 -0.466254,0.91955 -0.692111,1.38449 -0.186142,0.39042 -0.377422,0.7774 -0.549849,1.17694 -0.143729,0.32688 -0.29089,0.6516 -0.428642,0.98226 -0.114132,0.26434 -0.224033,0.53136 -0.331665,0.79959 -0.08396,0.20454 -0.166432,0.40965 -0.256534,0.61035 -0.05821,0.14803 -0.121176,0.29305 -0.177628,0.44196 -0.03604,0.0848 -0.07363,0.16791 -0.120646,0.2447 0,0 -3.890254,0.8153 -3.890254,0.8153 z" + inkscape:connector-curvature="0" /> + </g> +</svg> @@ -1,12 +1,11 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=8 format=2] [ext_resource path="res://scripts/base.gd" type="Script" id=1] [ext_resource path="res://scripts/camera.gd" type="Script" id=2] -[ext_resource path="res://world.tscn" type="PackedScene" id=3] -[ext_resource path="res://incubator.tscn" type="PackedScene" id=4] -[ext_resource path="res://combinator.tscn" type="PackedScene" id=5] -[ext_resource path="res://hud.tscn" type="PackedScene" id=6] -[ext_resource path="res://player.tscn" type="PackedScene" id=7] +[ext_resource path="res://incubator.tscn" type="PackedScene" id=3] +[ext_resource path="res://combinator.tscn" type="PackedScene" id=4] +[ext_resource path="res://hud.tscn" type="PackedScene" id=5] +[ext_resource path="res://player.tscn" type="PackedScene" id=6] [sub_resource type="Animation" id=1] @@ -68,15 +67,11 @@ omni_attenuation = 1.0 omni_shadow_mode = 0 omni_shadow_detail = 1 -[node name="World" parent="." instance=ExtResource( 3 )] - -transform = Transform( 0.02, 0, 0, 0, 0.02, 0, 0, 0, 0.02, 0, 0, -2.81418 ) - -[node name="Incubator" parent="." instance=ExtResource( 4 )] +[node name="Incubator" parent="." instance=ExtResource( 3 )] transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0, 0, -5 ) -[node name="Combinator" parent="." instance=ExtResource( 5 )] +[node name="Combinator" parent="." instance=ExtResource( 4 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -5, 0, 0 ) @@ -96,9 +91,9 @@ environment = null h_offset = 0.0 v_offset = 0.0 -[node name="HUD" parent="." instance=ExtResource( 6 )] +[node name="HUD" parent="." instance=ExtResource( 5 )] -[node name="Player" parent="." instance=ExtResource( 7 )] +[node name="Player" parent="." instance=ExtResource( 6 )] [node name="cmb2inc" type="Position3D" parent="."] diff --git a/combinator.tscn b/combinator.tscn index fb29e59..dd100e9 100644 --- a/combinator.tscn +++ b/combinator.tscn @@ -75,6 +75,10 @@ tracks/0/keys = { script = ExtResource( 2 ) +[node name="Cube" parent="."] + +material_override = ExtResource( 3 ) + [node name="StaticBody" type="StaticBody" parent="Cube"] input_ray_pickable = true @@ -135,7 +139,7 @@ size = Vector2( 400, 400 ) own_world = true world = null transparent_bg = false -msaa = 0 +msaa = 1 hdr = false disable_3d = false render_target_v_flip = true @@ -177,7 +181,7 @@ collision_mask = 1 [node name="Quad" type="Quad" parent="Area"] -transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0.955984, 0 ) +transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0.99, 0 ) layers = 1 material_override = SubResource( 4 ) cast_shadow = 1 @@ -205,7 +209,7 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.809103, 1.6303, -1.32872 ) [node name="point" type="Camera" parent="."] -transform = Transform( -3.09086e-08, -0.707107, 0.707107, -1.28028e-08, 0.707107, 0.707107, -1, 1.28028e-08, -3.09086e-08, 2.2, 3.5, 0 ) +transform = Transform( -2.45426e-08, -0.90859, 0.417688, -2.27357e-08, 0.417688, 0.90859, -1, 1.28028e-08, -3.09086e-08, 1.23998, 3.03074, 0 ) projection = 0 fov = 60.0 near = 0.1 @@ -219,10 +223,10 @@ v_offset = 0.0 [node name="bulb" type="OmniLight" parent="."] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1.17673, 2.26107, 1.77229 ) +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.818578, 2.10295, -1.66632 ) layers = 1 light_color = Color( 1, 1, 1, 1 ) -light_energy = 4.0 +light_energy = 15.0 light_negative = false light_specular = 0.1 light_cull_mask = -1 diff --git a/combinator_panel.tscn b/combinator_panel.tscn index f7a46d7..db54e82 100644 --- a/combinator_panel.tscn +++ b/combinator_panel.tscn @@ -13,7 +13,7 @@ rect_clip_content = false mouse_filter = 0 script = ExtResource( 1 ) -[node name="Tree" type="Tree" parent="."] +[node name="tree" type="Tree" parent="."] margin_left = 10.0 margin_top = 10.0 @@ -55,7 +55,7 @@ flat = false margin_left = 350.0 margin_top = 20.0 -margin_right = 394.0 +margin_right = 396.0 margin_bottom = 193.0 rect_clip_content = false mouse_filter = 0 @@ -68,7 +68,7 @@ icon = ExtResource( 4 ) flat = false clip_text = true -[connection signal="gui_input" from="Tree" to="." method="_on_Tree_gui_input"] +[connection signal="gui_input" from="tree" to="." method="_on_Tree_gui_input"] [connection signal="pressed" from="add" to="." method="_on_add_pressed"] diff --git a/export_presets.cfg b/export_presets.cfg index 0f5ef08..0c75b90 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -13,7 +13,7 @@ runnable=true custom_template/debug="" custom_template/release="" html/head_include="" -options/memory_size=3 +options/memory_size=4 options/target=1 texture_format/etc=true texture_format/etc2=false diff --git a/gray_mat.tres b/gray_mat.tres index 88420a6..2800293 100644 --- a/gray_mat.tres +++ b/gray_mat.tres @@ -1,6 +1,4 @@ -[gd_resource type="SpatialMaterial" load_steps=2 format=2] - -[ext_resource path="res://assets/gray_tex.png" type="Texture" id=1] +[gd_resource type="SpatialMaterial" format=2] [resource] @@ -19,8 +17,7 @@ params_depth_draw_mode = 0 params_line_width = 1.0 params_point_size = 1.0 params_billboard_mode = 0 -albedo_color = Color( 0.507812, 0.474091, 0.474091, 1 ) -albedo_texture = ExtResource( 1 ) +albedo_color = Color( 0.519531, 0.485031, 0.485031, 1 ) specular_mode = 0 specular_color = Color( 0.0736863, 0, 0.0736863, 1 ) specular_metalness = 0.1 @@ -1,8 +1,10 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=6 format=2] [ext_resource path="res://scripts/hud.gd" type="Script" id=1] [ext_resource path="res://scripts/multiverse_shop.gd" type="Script" id=2] [ext_resource path="res://scripts/storage.gd" type="Script" id=3] +[ext_resource path="res://scripts/howto.gd" type="Script" id=4] +[ext_resource path="res://scripts/messages.gd" type="Script" id=5] [node name="HUD" type="Node"] @@ -10,10 +12,10 @@ script = ExtResource( 1 ) [node name="ms_button" type="Button" parent="."] -margin_left = 620.0 -margin_top = 30.0 -margin_right = 752.0 -margin_bottom = 55.0 +margin_left = 5.0 +margin_top = 5.0 +margin_right = 137.0 +margin_bottom = 30.0 rect_clip_content = false hint_tooltip = "The best resources in the whole multi-verse!" mouse_filter = 0 @@ -26,6 +28,9 @@ flat = false [node name="ms" type="Control" parent="."] +visible = false +margin_left = -615.0 +margin_right = -615.0 rect_clip_content = false mouse_filter = 0 script = ExtResource( 2 ) @@ -33,9 +38,9 @@ script = ExtResource( 2 ) [node name="tabs" type="TabContainer" parent="ms"] margin_left = 620.0 -margin_top = 56.0 +margin_top = 31.0 margin_right = 893.0 -margin_bottom = 486.0 +margin_bottom = 459.0 rect_clip_content = false mouse_filter = 0 tab_align = 0 @@ -43,7 +48,6 @@ tabs_visible = true [node name="*" type="Tabs" parent="ms/tabs"] -editor/display_folded = true anchor_right = 1 anchor_bottom = 1 margin_left = 4.0 @@ -65,7 +69,6 @@ mouse_filter = 0 [node name="**" type="Tabs" parent="ms/tabs"] -editor/display_folded = true visible = false anchor_right = 1 anchor_bottom = 1 @@ -88,7 +91,6 @@ mouse_filter = 0 [node name="***" type="Tabs" parent="ms/tabs"] -editor/display_folded = true visible = false anchor_right = 1 anchor_bottom = 1 @@ -109,37 +111,31 @@ margin_right = 3.0 margin_bottom = 31.0 mouse_filter = 0 -[node name="other" type="Tabs" parent="ms/tabs"] +[node name="panel" type="Panel" parent="ms"] -editor/display_folded = true -visible = false -anchor_right = 1 -anchor_bottom = 1 -margin_left = 4.0 -margin_top = 32.0 -margin_right = 4.0 -margin_bottom = 4.0 +margin_left = 895.0 +margin_top = 55.0 +margin_right = 990.0 +margin_bottom = 460.0 rect_clip_content = false mouse_filter = 0 -[node name="items" type="Tree" parent="ms/tabs/other"] +[node name="Label" type="Label" parent="ms/panel"] anchor_right = 1 anchor_bottom = 1 -margin_left = 5.0 -margin_top = 5.0 -margin_right = 3.0 -margin_bottom = 31.0 -mouse_filter = 0 - -[node name="panel" type="Panel" parent="ms"] - -margin_left = 895.0 -margin_top = 80.0 -margin_right = 990.0 -margin_bottom = 485.0 +margin_left = -265.0 +margin_top = 375.0 +margin_right = 72.0 +margin_bottom = -1.0 +rect_scale = Vector2( 0.9, 0.9 ) rect_clip_content = false -mouse_filter = 0 +mouse_filter = 2 +size_flags_vertical = 0 +text = "Hint: mouse over an item for it's description." +percent_visible = 1.0 +lines_skipped = 0 +max_lines_visible = -1 [node name="buy" type="Button" parent="ms/panel"] @@ -160,10 +156,10 @@ flat = false [node name="storage_button" type="Button" parent="."] -margin_left = 755.0 -margin_top = 30.0 -margin_right = 814.0 -margin_bottom = 55.0 +margin_left = 757.0 +margin_top = 5.0 +margin_right = 816.0 +margin_bottom = 30.0 rect_clip_content = false mouse_filter = 0 toggle_mode = true @@ -175,7 +171,8 @@ flat = false [node name="storage" type="Control" parent="."] -visible = false +margin_left = 2.0 +margin_right = 2.0 rect_clip_content = false mouse_filter = 0 script = ExtResource( 3 ) @@ -183,9 +180,9 @@ script = ExtResource( 3 ) [node name="panel" type="Panel" parent="storage"] margin_left = 755.0 -margin_top = 55.0 -margin_right = 990.0 -margin_bottom = 485.0 +margin_top = 56.0 +margin_right = 1018.0 +margin_bottom = 460.0 rect_clip_content = false mouse_filter = 0 @@ -193,16 +190,16 @@ mouse_filter = 0 margin_left = 15.0 margin_top = 10.0 -margin_right = 220.0 -margin_bottom = 410.0 +margin_right = 252.0 +margin_bottom = 392.0 mouse_filter = 0 [node name="funds" type="PanelContainer" parent="."] -margin_left = 815.0 -margin_top = 28.0 -margin_right = 946.0 -margin_bottom = 57.0 +margin_left = 817.0 +margin_top = 3.0 +margin_right = 948.0 +margin_bottom = 32.0 rect_clip_content = false mouse_filter = 0 @@ -235,10 +232,100 @@ percent_visible = 1.0 lines_skipped = 0 max_lines_visible = -1 +[node name="help_button" type="Button" parent="."] + +margin_left = 951.0 +margin_top = 5.0 +margin_right = 1020.0 +margin_bottom = 30.0 +rect_clip_content = false +mouse_filter = 0 +toggle_mode = true +enabled_focus_mode = 2 +shortcut = null +group = null +text = "HowTo" +flat = false + +[node name="help" type="Control" parent="."] + +margin_left = 2.0 +margin_right = 2.0 +rect_clip_content = false +mouse_filter = 0 +script = ExtResource( 4 ) + +[node name="panel" type="Panel" parent="help"] + +margin_left = 756.0 +margin_top = 56.0 +margin_right = 1018.0 +margin_bottom = 460.0 +rect_clip_content = false +mouse_filter = 0 + +[node name="text" type="RichTextLabel" parent="help/panel"] + +margin_left = 7.0 +margin_top = 8.0 +margin_right = 252.0 +margin_bottom = 394.0 +mouse_filter = 0 +bbcode_enabled = true +bbcode_text = "" +visible_characters = -1 + +[node name="messages" type="Control" parent="."] + +margin_left = 380.0 +margin_top = 10.0 +margin_right = 745.0 +margin_bottom = 460.0 +rect_clip_content = false +mouse_filter = 2 +size_flags_vertical = 0 +script = ExtResource( 5 ) + +[node name="combibator_button" type="Button" parent="."] + +margin_left = 5.0 +margin_top = 575.0 +margin_right = 91.0 +margin_bottom = 595.0 +rect_clip_content = false +mouse_filter = 0 +toggle_mode = false +enabled_focus_mode = 2 +shortcut = null +group = null +text = "Combinator" +flat = false + +[node name="incubator_button" type="Button" parent="."] + +margin_left = 95.0 +margin_top = 575.0 +margin_right = 168.0 +margin_bottom = 595.0 +rect_clip_content = false +mouse_filter = 0 +toggle_mode = false +enabled_focus_mode = 2 +shortcut = null +group = null +text = "Incubator" +flat = false + [connection signal="pressed" from="ms_button" to="." method="_on_ms_button_pressed"] [connection signal="pressed" from="ms/panel/buy" to="ms" method="_on_buy_pressed"] [connection signal="pressed" from="storage_button" to="." method="_on_storage_button_pressed"] +[connection signal="pressed" from="help_button" to="." method="_on_help_button_pressed"] + +[connection signal="pressed" from="combibator_button" to="." method="_on_combibator_button_pressed"] + +[connection signal="pressed" from="incubator_button" to="." method="_on_incubator_button_pressed"] + diff --git a/incubator.tscn b/incubator.tscn index 59f2e9d..0502071 100644 --- a/incubator.tscn +++ b/incubator.tscn @@ -374,7 +374,6 @@ script = ExtResource( 2 ) [node name="Cube" parent="."] -editor/display_folded = true material_override = ExtResource( 3 ) [node name="StaticBody" type="StaticBody" parent="Cube"] @@ -1,7 +1,7 @@ config_version=3 [application] -name="World Factory^TM" +name="World Factory" main_scene="res://base.tscn" icon="res://icon.png" @@ -13,5 +13,7 @@ multithread/thread_rid_pool_prealloc=60 viewport/default_clear_color=Color( 0, 0, 0, 1 ) quality/msaa=1 -gles3/shadow_filter_mode=2 quality/hdr=false +threads/thread_model=2 +quality/anisotropic_filter_level=2.0 +reflections/high_quality_vct_gi=false diff --git a/out/html/index.html b/out/html/index.html index abd526e..36e1789 100644 --- a/out/html/index.html +++ b/out/html/index.html @@ -266,7 +266,7 @@ var module = { thisProgram: BASE_NAME, wasmBinaryFile: BASE_NAME + '.wasm', - TOTAL_MEMORY: 268435456, + TOTAL_MEMORY: 536870912, print: function print(text) { if (arguments.length > 1) { text = Array.prototype.slice.call(arguments).join(" "); diff --git a/out/html/index.pck b/out/html/index.pck Binary files differindex c426cc7..1be77f2 100644 --- a/out/html/index.pck +++ b/out/html/index.pck diff --git a/out/html/indexfs.js b/out/html/indexfs.js index d79a4a1..3d3a09f 100644 --- a/out/html/indexfs.js +++ b/out/html/indexfs.js @@ -8,7 +8,7 @@ if (!Module.expectedDataFileDownloads) { Module.expectedDataFileDownloads++; (function() { - const PACK_FILE_NAME = 'index.pck'; const PACK_FILE_SIZE = 288180; function fetchRemotePackage(packageName, callback, errback) { + const PACK_FILE_NAME = 'index.pck'; const PACK_FILE_SIZE = 454948; function fetchRemotePackage(packageName, callback, errback) { var xhr = new XMLHttpRequest(); xhr.open('GET', packageName, true); xhr.responseType = 'arraybuffer'; diff --git a/scripts/base.gd b/scripts/base.gd index 3d138d9..6b2bfd5 100644 --- a/scripts/base.gd +++ b/scripts/base.gd @@ -1,17 +1,15 @@ extends Node -var Game = preload("res://base.tscn") -var Wrld = preload("res://world.tscn") -var Incubator = preload("res://incubator.tscn") +const Wrld = preload("res://world.tscn") +const Builder = preload("res://scripts/builder.gd") var cam = null +var builder = null func _ready(): randomize() self.cam = get_node("Camera") - -func _process(delta): - pass + self.builder = Builder.new() func _input(event): if event.type == InputEvent.MOUSE_BUTTON: @@ -42,7 +40,8 @@ func _input(event): if s != null: get_node("Incubator").push_world(s) if event.scancode == KEY_N: - var w = Wrld.instance() + #var w = Wrld.instance() + var w = self.builder.combine(Vector3(0,0,0), []) w.set_scale(Vector3(0.02, 0.02, 0.02)) add_child(w) get_node("Incubator").push_world(w) diff --git a/scripts/builder.gd b/scripts/builder.gd new file mode 100644 index 0000000..9a43437 --- /dev/null +++ b/scripts/builder.gd @@ -0,0 +1,60 @@ +extends Object + +const Wrld = preload("res://world.tscn") +const Items = preload("res://scripts/items.gd") + +var items = null + +func _init(): + self.items = Items.new() + +func build(where): + var w = Wrld.instance() + w.set_scale(Vector3(0.02, 0.02, 0.02)) + w.set_translation(where) + return w + +func can_combine(materials): + var has_solid = false + var has_gas = false + for id in materials: + var category = self.items.category(id) + if category == "solid": + has_solid = true + if category == "gas": + has_gas = true + return has_solid and has_gas + +func combine(where, materials): + var w = build(where) + var mass = 0 + var volume = 0 + var color = Color(0.3,0.3,0.3) + var gas_mass = 0 + var gas_volume = 0 + var gas_color = Color(0.5,0.5,0.6,0.35) + + for mat in materials: + var item = self.items.get(mat) + var category = self.items.category(mat) + if category == "solid": + mass += item.data["mass"] + #volume += item.data["volume"] + var s = item.data["color"] + color = color.blend(Color(s)) + + if category == "gas": + gas_mass += item.data["mass"] + gas_volume += item.data["volume"] + var s = item.data["color"] + gas_color = gas_color.blend(Color(s)) + + w.materials = materials + w.mass = mass + w.volume = volume + w.color = color + w.gas_mass = gas_mass + w.gas_volume = gas_volume + w.gas_color = gas_color + w.call_deferred("build") + return w diff --git a/scripts/combinator.gd b/scripts/combinator.gd index 2bc7740..43ebe0b 100644 --- a/scripts/combinator.gd +++ b/scripts/combinator.gd @@ -1,11 +1,20 @@ extends Spatial +const Builder = preload("res://scripts/builder.gd") +const CombinatorTemplate = preload("res://scripts/template_combine.gd") + var prev_pos = null var panel = null +var world = null + +var templater = null +var builder = null func _ready(): get_node("Area/Quad").get_material_override().set_texture(SpatialMaterial.DIFFUSE_LAMBERT, get_node("Viewport").get_texture()) self.panel = get_node("Viewport/CombinatorPanel") + self.templater = CombinatorTemplate.new() + self.builder = Builder.new() set_process_input(true) func _on_Area_input_event( camera, event, click_pos, click_normal, shape_idx ): @@ -35,5 +44,17 @@ func _on_panel_input_event( camera, event, click_pos, click_normal, shape_idx ): if event.type == InputEvent.MOUSE_BUTTON and event.button_index == BUTTON_LEFT and event.is_pressed(): print("panel") get_node("animation").play("click") + var panel = get_node("Viewport/CombinatorPanel") + var ids = panel.get_ids() + var message = null + if ids != null and ids.size() > 0 and self.builder.can_combine(ids): + self.world = self.builder.combine(get_node("spawn").get_global_transform().origin, ids) + get_tree().get_root().get_node("Game").add_child(self.world) + panel.clear_all() + message = self.templater.template(self.world) + else: + message = "Cannot combine!" + get_tree().get_root().get_node("Game/HUD").display_message(message, 15) +
\ No newline at end of file diff --git a/scripts/combinator_panel.gd b/scripts/combinator_panel.gd index c4822e8..65ba69b 100644 --- a/scripts/combinator_panel.gd +++ b/scripts/combinator_panel.gd @@ -1,10 +1,22 @@ extends Panel -var Items = preload("res://scripts/items.gd") +const Items = preload("res://scripts/items.gd") + var items = null +var tree func _ready(): self.items = Items.new() + self.tree = get_node("tree") + self.tree.create_item() + self.tree.set_columns(2) + self.tree.set_column_title(0, "Item") + self.tree.set_column_title(1, "Amount") + self.tree.set_column_titles_visible(true) + self.tree.set_column_expand(1, false) + self.tree.set_column_min_width(1,60) + self.tree.set_hide_root(true) + self.tree.set_select_mode(Tree.SELECT_ROW) set_process_input(true) func _input(event): @@ -14,8 +26,26 @@ func _on_Tree_gui_input( ev ): #print(ev) pass -func get_items(): - pass +func get_ids(): + var ids = [] + var root = self.tree.get_root() + if root == null: + return ids + var node = root.get_children() + while node != null: + ids.append(node.get_metadata(0)["id"]) + node = node.get_next() + return ids + +func clear_all(): + var root = self.tree.get_root() + if root == null: + return + var node = root.get_children() + while node != null: + root.remove_child(node) + node = node.get_next() + self.tree.update() func _on_add_pressed(): var player = get_tree().get_root().get_node("Game/Player") @@ -24,13 +54,37 @@ func _on_add_pressed(): print(player.storage) print(storage.get_selected()) - if player.has_item(storage.get_selected()): - print("has") - player.remove_item(storage.get_selected(), 1) + var item = storage.get_selected() + if item != null and player.has_item(item["id"]): + var itm = player.get_item(item["id"]) + player.remove_item(item["id"], 1) + var root = self.tree.get_root() + var line = itm.insert_in_tree(tree, root) + line.set_text(1, "1") func _on_remove_pressed(): - pass # replace with function body - + var player = get_tree().get_root().get_node("Game/Player") + var item = self.get_selected() + if item != null: + print(item) + var node = self.tree.get_selected() + node.deselect(0) + print(node) + var root = self.tree.get_root() + root.remove_child(node) + self.tree.update() + player.add_item(item["id"], 1) func _on_storage_pressed(): - get_tree().get_root().get_node("Game/HUD").popup_storage() + get_tree().get_root().get_node("Game/HUD").popup("storage") + +func get_selected(): + var root = self.tree.get_root() + if root == null: + return null + var itm = root.get_children() + while itm != null: + if itm.is_selected(0): + return itm.get_metadata(0) + itm = itm.get_next() + return null
\ No newline at end of file diff --git a/scripts/howto.gd b/scripts/howto.gd new file mode 100644 index 0000000..1259174 --- /dev/null +++ b/scripts/howto.gd @@ -0,0 +1,15 @@ +extends Control + +var title +var text + +func _ready(): + var file = File.new() + file.open("res://assets/howto.json", File.READ) + var content = file.get_as_text() + file.close() + var data = parse_json(content) + self.title = data["title"] + self.text = data["text"] + get_node("panel/text").set_bbcode("[b]" + self.title + "[/b]\n\n" + self.text) + #get_node("panel/text").add_text(self.text)
\ No newline at end of file diff --git a/scripts/hud.gd b/scripts/hud.gd index 80c58a0..dcf4c88 100644 --- a/scripts/hud.gd +++ b/scripts/hud.gd @@ -4,32 +4,41 @@ func _ready(): pass func _on_ms_button_pressed(): - var visible = get_node("ms").is_visible() - if visible: - get_node("ms").set_visible(false) - else: - popup_shop() + _toggle("ms") func _on_storage_button_pressed(): - var visible = get_node("storage").is_visible() - if visible: - get_node("storage").set_visible(false) - else: - popup_storage() + popup("storage") + +func _on_help_button_pressed(): + popup("help") -func _popup(which): - var tabs = ["ms", "storage"] - for tab in tabs: - get_node(tab).set_visible(tab == which) +func _toggle(which): + var visible = get_node(which).is_visible() + get_node(which).set_visible(!visible) -func popup_storage(): - _popup("storage") +func popup(which): + var tabs = ["storage", "help"] + for tab in tabs: + var vis = false + if tab == which: + vis = !get_node(tab).is_visible() + get_node(tab).set_visible(vis) -func popup_shop(): - _popup("ms") - func set_funds(cash): get_node("funds/cash").set_text(str(cash)) -func update_storage(storage): - get_node("storage").update_storage(storage) +func update_storage(id, amount): + get_node("storage").update_storage(id, amount) + +func display_message(message, time=5): + get_node("messages").display_message(message, time) + +func _on_combibator_button_pressed(): + var cam = get_tree().get_root().get_node("Game/Camera") + var combinator = get_tree().get_root().get_node("Game/Combinator") + cam.select(combinator, combinator.get_node("point")) + +func _on_incubator_button_pressed(): + var cam = get_tree().get_root().get_node("Game/Camera") + var incubator = get_tree().get_root().get_node("Game/Incubator") + cam.select(incubator, incubator.get_node("point")) diff --git a/scripts/items.gd b/scripts/items.gd index a6ca8be..e2a1106 100644 --- a/scripts/items.gd +++ b/scripts/items.gd @@ -1,5 +1,9 @@ extends Object +const icon_triangle = preload("res://assets/triangle.png") +const icon_waves = preload("res://assets/waves.png") +const icon_triangles = preload("res://assets/triangles.png") + var data = null func _init(): @@ -9,9 +13,54 @@ func _init(): file.close() self.data = parse_json(content) +class Item: + extends Object + + var data + var category + var icon + + func _init(category, data, icon): + self.category = category + self.data = data + self.icon = icon + + func id(): + return data["id"] + + func insert_in_tree(tree, parent=null): + var item = tree.create_item(parent) + item.set_text(0, data["name"]) + item.set_tooltip(0, data["desc"]) + item.set_metadata(0, data) + item.set_icon_max_width(0, 20) + if self.icon != null: + item.set_icon(0, self.icon) + return item + + func insert_in_shop(tree, parent=null): + var item = self.insert_in_tree(tree, parent) + item.set_text(1, str(data["cost"])) + +func _get_icon(category): + if category == "solid": + return self.icon_triangle + elif category == "gas": + return self.icon_waves + elif category == "precursor": + pass + elif category == "life": + return self.icon_triangles + func get(id): for cat in self.data.keys(): for item in self.data[cat]: if item["id"] == id: - return item - return null
\ No newline at end of file + return Item.new(cat, item, self._get_icon(cat)) + return null + +func category(id): + for cat in self.data.keys(): + for item in self.data[cat]: + if item["id"] == id: + return cat
\ No newline at end of file diff --git a/scripts/messages.gd b/scripts/messages.gd new file mode 100644 index 0000000..236ebd1 --- /dev/null +++ b/scripts/messages.gd @@ -0,0 +1,51 @@ +extends Control + +var count = 0 +var labels = [] +var runs = [] +var lengths = [] + +func _ready(): + set_process(true) + +func _process(delta): + var to_remove = [] + for i in range(count): + var run = runs[i] + var len = lengths[i] + var label = labels[i] + var far = run + delta + if far >= (3*len/4): + label.set_modulate(Color(1,1,1,0.3)) + elif far >= len/2: + label.set_modulate(Color(1,1,1,0.5)) + if far >= len: + to_remove.append(i) + else: + runs[i] += delta + for i in to_remove: + var label = labels[i] + remove_child(label) + label.queue_free() + labels.remove(i) + runs.remove(i) + lengths.remove(i) + count -= 1 + +func display_message(message, time): + var label = Label.new() + label.set_text(message) + add_child(label) + + if count > 0: + var offset = label.get_size().y + for i in range(count): + var lab = labels[i] + var lab_pos = lab.get_global_position() + lab_pos.y += offset + lab.set_global_position(lab_pos) + + labels.push_back(label) + runs.push_back(0) + lengths.push_back(time) + count+=1
\ No newline at end of file diff --git a/scripts/multiverse_shop.gd b/scripts/multiverse_shop.gd index 494ccd5..d4c32b0 100644 --- a/scripts/multiverse_shop.gd +++ b/scripts/multiverse_shop.gd @@ -1,16 +1,20 @@ extends Control -var Items = preload("res://scripts/items.gd") +const Items = preload("res://scripts/items.gd") func _ready(): - var map = {"1": get_node("tabs/*/items"), - "2": get_node("tabs/**/items"), - "3": get_node("tabs/***/items"), - "other": get_node("tabs/other/items")} + var map = {"solid": get_node("tabs/*/items"), + "gas": get_node("tabs/*/items"), + "precursor": get_node("tabs/**/items"), + "life": get_node("tabs/***/items")} var items = Items.new() for k in items.data.keys(): var tree = map[k] - var root = tree.create_item() + var root = null + if tree.get_root() == null: + root = tree.create_item() + else: + root = tree.get_root() tree.set_columns(2) tree.set_column_title(0, "Item") tree.set_column_title(1, "Cost") @@ -20,17 +24,10 @@ func _ready(): tree.set_hide_root(true) tree.set_select_mode(Tree.SELECT_ROW) for i in range(items.data[k].size()): - var item = items.data[k][i] - var itm = tree.create_item(root) - itm.set_text(0, item["name"]) - itm.set_text(1, str(item["cost"])) - itm.set_tooltip(0, item["desc"]) - itm.set_metadata(0, item) - itm.set_collapsed(true) - - var desc = tree.create_item(itm) - desc.set_text(0, item["desc"]) - desc.set_selectable(0, false) + var dict = items.data[k][i] + var id = dict["id"] + var item = items.get(id) + item.insert_in_shop(tree, root) func _on_buy_pressed(): var tab = get_node("tabs").get_current_tab_control() @@ -40,7 +37,7 @@ func _on_buy_pressed(): var item = itm.get_metadata(0) var player = get_tree().get_root().get_node("Game/Player") if player.cash >= item["cost"]: - player.add_item(item["id"], item, 1) + player.add_item(item["id"], 1) player.cash -= item["cost"] else: pass
\ No newline at end of file diff --git a/scripts/player.gd b/scripts/player.gd index c8c40eb..746d2d9 100644 --- a/scripts/player.gd +++ b/scripts/player.gd @@ -1,11 +1,15 @@ extends Node +const Items = preload("res://scripts/items.gd") +var items + var cash = 1000 setget set_cash, get_cash var storage = {} +var inventory = {} func _ready(): + self.items = Items.new() _update_funds() - _update_storage() func get_cash(): return cash @@ -14,24 +18,33 @@ func set_cash(csh): cash = csh _update_funds() -func add_item(id, item, amount): +func add_item(id, amount): if storage.has(id): storage[id] += amount else: storage[id] = amount - _update_storage() + inventory[id] = items.get(id) + _update_storage(id, storage[id]) func has_item(id, amount=1): return storage.has(id) and storage[id] >= amount +func get_item(id): + return inventory[id] + +func get_item_count(id): + return storage[id] + func remove_item(id, amount): + print("remove", id, amount) if storage.has(id) and storage[id] >= amount: storage[id] -= amount - _update_storage() + print("new amount", storage[id]) + _update_storage(id, storage[id]) func _update_funds(): get_tree().get_root().get_node("Game/HUD").set_funds(cash) -func _update_storage(): - get_tree().get_root().get_node("Game/HUD").update_storage(storage) +func _update_storage(id, amount): + get_tree().get_root().get_node("Game/HUD").update_storage(id, amount)
\ No newline at end of file diff --git a/scripts/storage.gd b/scripts/storage.gd index bbac5e2..dd7d10e 100644 --- a/scripts/storage.gd +++ b/scripts/storage.gd @@ -1,13 +1,10 @@ extends Control -var Items = preload("res://scripts/items.gd") - +const Items = preload("res://scripts/items.gd") var items -var storage = {} var tree func _ready(): - self.items = Items.new() self.tree = get_node("panel/items") self.tree.create_item() self.tree.set_columns(2) @@ -15,47 +12,36 @@ func _ready(): self.tree.set_column_title(1, "Amount") self.tree.set_column_titles_visible(true) self.tree.set_column_expand(1, false) - self.tree.set_column_min_width(1,50) + self.tree.set_column_min_width(1,60) self.tree.set_hide_root(true) self.tree.set_select_mode(Tree.SELECT_ROW) + self.items = Items.new() -func _update_item(id, amount): - var child = self.tree.get_root().get_children() - while child != null: - var meta = child.get_metadata(0) - if meta == id: - if amount == 0: - self.tree.get_root().remove_child(child) - else: - child.set_text(1, str(amount)) - return - child = child.get_next() - - -func _add_item(id, amount): - var root = self.tree.get_root() - var item = self.tree.create_item(root) - item.set_text(0, self.items.get(id)["name"]) - item.set_text(1, str(amount)) - item.set_metadata(0, id) - -func update_storage(update): - for k in update.keys(): - print("key: ", k) - if self.storage.has(k): - if self.storage[k] != update[k]: - _update_item(k, update[k]) - if update[k] == 0: - self.storage.erase(k) - else: - self.storage[k] = update[k] - else: - self.storage[k] = update[k] - _add_item(k, update[k]) - - func get_selected(): var itm = self.tree.get_selected() if itm != null and itm.is_selected(0): return itm.get_metadata(0) return null + +func update_storage(id, amount): + var root = self.tree.get_root() + if root == null: + return + var node = root.get_children() + while node != null: + var meta = node.get_metadata(0) + if meta["id"] == id: + break + node = node.get_next() + + if amount == 0: + if node != null: + root.remove_child(node) + self.tree.update() + else: + if node == null: + var item = items.get(id) + node = item.insert_in_tree(tree, root) + node.set_text(1, str(amount)) + +
\ No newline at end of file diff --git a/scripts/template.gd b/scripts/template.gd new file mode 100644 index 0000000..6e1affc --- /dev/null +++ b/scripts/template.gd @@ -0,0 +1,30 @@ +extends Node + +var data = null +var regex = null + +func _init(path): + var file = File.new() + file.open(path, File.READ) + var content = file.get_as_text() + file.close() + self.data = parse_json(content) + self.regex = RegEx.new() + self.regex.compile("/(.*?)/") + +func replace_all(base, values): + var mtch = self.regex.search(base) + while mtch != null: + var key = mtch.get_string(1) + var replace = "" + if values.has(key): + var from = values[key] + if typeof(from) == TYPE_DICTIONARY: + replace = from[from.keys()[randi() % from.size()]] + elif typeof(from) == TYPE_ARRAY: + replace = from[randi() % from.size()] + else: + replace = str(from) + base = self.regex.sub(base, replace) + mtch = self.regex.search(base) + return base
\ No newline at end of file diff --git a/scripts/template_combine.gd b/scripts/template_combine.gd new file mode 100644 index 0000000..9791703 --- /dev/null +++ b/scripts/template_combine.gd @@ -0,0 +1,10 @@ +extends "res://scripts/template.gd" + +var bases = null + +func _init().("res://assets/combinator.json"): + self.bases = self.data["bases"] + +func template(world): + var base = self.bases[randi() % self.bases.size()] + return self.replace_all(base, self.data) diff --git a/scripts/template_incubate.gd b/scripts/template_incubate.gd new file mode 100644 index 0000000..f5c834c --- /dev/null +++ b/scripts/template_incubate.gd @@ -0,0 +1,4 @@ +extends "res://scripts/template.gd" + +func _init().("res://assets/incubator.json"): + pass diff --git a/scripts/world.gd b/scripts/world.gd index c871e81..e040524 100644 --- a/scripts/world.gd +++ b/scripts/world.gd @@ -1,23 +1,41 @@ extends Spatial -const SIZE = 15 +export var SIZE = 15 + +const Cube = preload("res://mesh/cube.obj") +const GrayMat = preload("res://gray_mat.tres") +const GlassMat = preload("res://glass.tres") +const House = preload("res://house.tscn") +const Pine = preload("res://tree_pine.tscn") +const Oak = preload("res://tree_oak.tscn") + +var materials + +var mass +var volume +var color +var gas_mass +var gas_volume +var gas_color + +var material +var glass_material -var Cube = preload("res://mesh/cube.obj") -var House = preload("res://house.tscn") -var Pine = preload("res://tree_pine.tscn") -var Oak = preload("res://tree_oak.tscn") func _enter_tree(): - var pn = Pine.instance() - pn.translate(Vector3(2,1,2)) - add_child(pn) - var ok = Oak.instance() - ok.translate(Vector3(-2,1,2)) - add_child(ok) - var hs = House.instance() - hs.translate(Vector3(0,1,2)) - hs.rotate_y(PI/2) - add_child(hs) + pass +# var pn = Pine.instance() +# pn.translate(Vector3(2,1,2)) +# add_child(pn) +# var ok = Oak.instance() +# ok.translate(Vector3(-2,1,2)) +# add_child(ok) +# var hs = House.instance() +# hs.translate(Vector3(0,1,2)) +# hs.rotate_y(PI/2) +# add_child(hs) + +func build(): _make_ball(SIZE, Vector3(0,0,0)) func _make_ball(size, center): @@ -37,8 +55,19 @@ func _make_ball(size, center): count += 1 else: line_y.append(null) + + + self.material = GrayMat.duplicate(true) + self.material.set_albedo(self.color) + self.glass_material = GlassMat.duplicate(true) + self.glass_material.set_albedo(self.gas_color) + get_node("CoverOther/Icosphere").set_material_override(self.glass_material) + + for i in range(Cube.get_surface_count()): + Cube.surface_set_material(i, self.material) var multi = MultiMesh.new() multi.set_transform_format(MultiMesh.TRANSFORM_3D) + multi.set_color_format(MultiMesh.COLOR_FLOAT) multi.set_mesh(Cube) multi.set_instance_count(count) var i = 0 @@ -56,6 +85,7 @@ func _make_ball(size, center): var trans = Transform() trans = trans.translated(pos) multi.set_instance_transform(i, trans) + multi.set_instance_color(i, self.color) i += 1 var instance = MultiMeshInstance.new() instance.set_multimesh(multi) @@ -10,17 +10,18 @@ radius = 15.0 [node name="World" type="Spatial"] script = ExtResource( 1 ) +SIZE = 15 [node name="spot" type="SpotLight" parent="."] transform = Transform( 1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 20, 0 ) layers = 1 -light_color = Color( 0.819993, 0.824219, 0.283325, 1 ) -light_energy = 2.0 +light_color = Color( 0.771148, 0.773438, 0.480377, 1 ) +light_energy = 1.5 light_negative = false light_specular = 0.5 light_cull_mask = -1 -shadow_enabled = true +shadow_enabled = false shadow_color = Color( 0, 0, 0, 1 ) shadow_bias = 1.0 shadow_contact = 0.0 |
