diff --git a/artwork/wires/items.psd b/artwork/wires/items.psd index 0bb9bd50..ff296c91 100644 --- a/artwork/wires/items.psd +++ b/artwork/wires/items.psd @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c35f217cbc3c687e3ee7c25a410ce953b38637e106b8ea348caeca55bfeac394 -size 70555 +oid sha256:f2b3fec64e5d005a31c0a5876507c881b6b7f0e59d4f03bc97f594f33943b4ce +size 70541 diff --git a/res_raw/sprites/wires/positive_energy.png b/res_raw/sprites/wires/positive_energy.png index bd2a3cd6..7428500e 100644 Binary files a/res_raw/sprites/wires/positive_energy.png and b/res_raw/sprites/wires/positive_energy.png differ diff --git a/src/js/game/blueprint.js b/src/js/game/blueprint.js index 85b8d171..fe6e5323 100644 --- a/src/js/game/blueprint.js +++ b/src/js/game/blueprint.js @@ -52,7 +52,8 @@ export class Blueprint { } averagePosition.divideScalarInplace(uids.length); - const blueprintOrigin = averagePosition.floor(); + const blueprintOrigin = averagePosition.subScalars(0.5, 0.5).floor(); + for (let i = 0; i < uids.length; ++i) { newEntities[i].components.StaticMapEntity.origin.subInplace(blueprintOrigin); } diff --git a/src/js/game/buildings/energy_generator.js b/src/js/game/buildings/energy_generator.js index 4580ed5f..ba7a1e97 100644 --- a/src/js/game/buildings/energy_generator.js +++ b/src/js/game/buildings/energy_generator.js @@ -81,6 +81,7 @@ export class MetaEnergyGenerator extends MetaBuilding { layer: enumLayer.wires, }, ], + instantEject: true, }) ); @@ -88,7 +89,7 @@ export class MetaEnergyGenerator extends MetaBuilding { new EnergyGeneratorComponent({ // Set by the energy generator system later requiredKey: null, - acceptorSlotIndex: 2, + wasteAcceptorSlotIndex: 2, }) ); diff --git a/src/js/game/components/energy_consumer.js b/src/js/game/components/energy_consumer.js index 5117cc01..6e54af86 100644 --- a/src/js/game/components/energy_consumer.js +++ b/src/js/game/components/energy_consumer.js @@ -12,16 +12,27 @@ export class EnergyConsumerComponent extends Component { return { bufferSize: types.float, perCharge: types.float, - stored: types.float, - piledOutput: types.float, batteryPosition: types.vector, energyType: types.enum(enumItemType), wasteType: types.enum(enumItemType), acceptorSlotIndex: types.uint, ejectorSlotIndex: types.uint, + + stored: types.float, + piledOutput: types.float, }; } + duplicateWithoutContents() { + return new EnergyConsumerComponent({ + bufferSize: this.bufferSize, + perCharge: this.perCharge, + batteryPosition: this.batteryPosition.copy(), + acceptorSlotIndex: this.acceptorSlotIndex, + ejectorSlotIndex: this.ejectorSlotIndex, + }); + } + /** * * @param {object} param0 diff --git a/src/js/game/components/energy_generator.js b/src/js/game/components/energy_generator.js index 00247465..23f5dc43 100644 --- a/src/js/game/components/energy_generator.js +++ b/src/js/game/components/energy_generator.js @@ -3,7 +3,7 @@ import { BaseItem } from "../base_item"; import { Component } from "../component"; import { ShapeItem } from "../items/shape_item"; -const maxQueueSize = 20; +const maxQueueSize = 4; export class EnergyGeneratorComponent extends Component { static getId() { @@ -14,16 +14,24 @@ export class EnergyGeneratorComponent extends Component { return { requiredKey: types.nullable(types.string), itemsInQueue: types.uint, + wasteAcceptorSlotIndex: types.uint, }; } + duplicateWithoutContents() { + return new EnergyGeneratorComponent({ + requiredKey: null, + wasteAcceptorSlotIndex: this.wasteAcceptorSlotIndex, + }); + } + /** * * @param {object} param0 - * @param {string} param0.requiredKey Which shape this generator needs, can be null if not computed yet - * @param {number} param0.acceptorSlotIndex + * @param {string=} param0.requiredKey Which shape this generator needs, can be null if not computed yet + * @param {number} param0.wasteAcceptorSlotIndex Which slot accepts the waste */ - constructor({ requiredKey, acceptorSlotIndex = 0 }) { + constructor({ requiredKey, wasteAcceptorSlotIndex = 0 }) { super(); this.requiredKey = requiredKey; @@ -37,7 +45,7 @@ export class EnergyGeneratorComponent extends Component { * Stores which slot accepts the waste * @type {number} */ - this.acceptorSlotIndex = acceptorSlotIndex; + this.wasteAcceptorSlotIndex = wasteAcceptorSlotIndex; } /** @@ -46,7 +54,7 @@ export class EnergyGeneratorComponent extends Component { * @param {number} slot */ tryTakeItem(item, slot) { - if (slot === this.acceptorSlotIndex) { + if (slot === this.wasteAcceptorSlotIndex) { // this is the acceptor slot on the wires layer // just destroy it return true; diff --git a/src/js/game/components/wired_pins.js b/src/js/game/components/wired_pins.js index d34c41b3..0d331a68 100644 --- a/src/js/game/components/wired_pins.js +++ b/src/js/game/components/wired_pins.js @@ -48,6 +48,20 @@ export class WiredPinsComponent extends Component { this.setSlots(slots); } + duplicateWithoutContents() { + const slots = []; + for (let i = 0; i < this.slots.length; ++i) { + const slot = this.slots[i]; + slots.push({ + pos: slot.pos.copy(), + type: slot.type, + direction: slot.direction, + }); + } + + return new WiredPinsComponent({ slots }); + } + /** * Sets the slots of this building * @param {Array} slots diff --git a/src/js/platform/browser/wrapper.js b/src/js/platform/browser/wrapper.js index d6c722ae..bbe9d221 100644 --- a/src/js/platform/browser/wrapper.js +++ b/src/js/platform/browser/wrapper.js @@ -82,7 +82,7 @@ export class PlatformWrapperImplBrowser extends PlatformWrapperInterface { return new Promise(resolve => { logger.log("Detecting storage"); - if (!window.indexedDB) { + if (!window.indexedDB || G_IS_DEV) { logger.log("Indexed DB not supported"); this.app.storage = new StorageImplBrowser(this.app); resolve(); diff --git a/src/js/savegame/savegame_serializer.js b/src/js/savegame/savegame_serializer.js index 1a2c8d74..eff802a0 100644 --- a/src/js/savegame/savegame_serializer.js +++ b/src/js/savegame/savegame_serializer.js @@ -26,10 +26,6 @@ export class SavegameSerializer { * @returns {object} */ generateDumpFromGameRoot(root, sanityChecks = true) { - // Finalize particles before saving (Like granting destroy indicator rewards) - // root.particleMgr.finalizeBeforeSave(); - // root.uiParticleMgr.finalizeBeforeSave(); - // Now store generic savegame payload const data = { camera: root.camera.serialize(), diff --git a/src/js/savegame/serializer_internal.js b/src/js/savegame/serializer_internal.js index ec761beb..8df6f6e4 100644 --- a/src/js/savegame/serializer_internal.js +++ b/src/js/savegame/serializer_internal.js @@ -1,15 +1,9 @@ -/* typehints:start */ -import { GameRoot } from "../game/root"; -/* typehints:end */ - import { gComponentRegistry } from "../core/global_registries"; -import { createLogger } from "../core/logging"; import { Entity } from "../game/entity"; +import { enumLayer, GameRoot } from "../game/root"; // Internal serializer methods export class SerializerInternal { - constructor() {} - /** * Serializes an array of entities * @param {Array} array @@ -45,6 +39,11 @@ export class SerializerInternal { deserializeEntity(root, payload) { const entity = new Entity(root); this.deserializeComponents(entity, payload.components); + entity.layer = payload.layer; + + if (!enumLayer[payload.layer]) { + assert(false, "Invalid layer: " + payload.layer); + } root.entityMgr.registerEntity(entity, payload.uid); diff --git a/translations/base-en.yaml b/translations/base-en.yaml index 93bb2b4f..7f03d947 100644 --- a/translations/base-en.yaml +++ b/translations/base-en.yaml @@ -21,7 +21,7 @@ steamPage: # This is the short text appearing on the steam page - shortText: shapez.io is a game about building factories to automate the creation and combination of increasingly complex shapes within an infinite map. + shortText: shapez.io is a game about building factories to automate the creation and processing of increasingly complex shapes across an infinitely expanding map. # This is the text shown above the discord link discordLink: Official Discord - Chat with me! @@ -33,36 +33,40 @@ steamPage: longText: >- [img]{STEAM_APP_IMAGE}/extras/store_page_gif.gif[/img] - shapez.io is a game about building factories to automate the creation and combination of shapes. Deliver the increasingly complex shapes to progress within the game and unlock upgrades to speed up your factory. + shapez.io is a game about building factories to automate the creation and processing of increasingly complex shapes across an infinitely expanding map. + Upon delivering the requested shapes you will progress within the game and unlock upgrades to speed up your factory. - Since the demand rises, you will have to scale up your factory to fit the needs - Don't forget about resources though, you will have to expand in the [b]infinite map[/b]! + As the demand for shapes increases, you will have to scale up your factory to meet the demand - Don't forget about resources though, you will have to expand across the [b]infinite map[/b]! Obviously shapes can get boring, so you need to mix colors and paint your shapes with it - Combine red, green and blue color resources to produce different colors and paint shapes with it to satisfy the demand. - This game features 18 levels (Which should keep you busy for hours already!) but I'm constantly adding new content - There is a lot planned! + This game features 18 progressive levels (Which should keep you busy for hours already!) but I'm constantly adding new content - There is a lot planned! + + Purchasing the game gives you access to the standalone version which has additional features and you'll also receive access to newly developed features. [img]{STEAM_APP_IMAGE}/extras/header_standalone_advantages.png[/img] [list] - [*] Coming soon: Wires & Energy! Roughly end of July 2020. - [*] Coming soon: More Levels [*] Dark Mode [*] Unlimited Waypoints [*] Unlimited Savegames - [*] More settings - [*] Allow me to further develop shapez.io ❤️ + [*] Additional settings + [*] Coming soon: Wires & Energy! Aiming for (roughly) end of July 2020. + [*] Coming soon: More Levels + [*] Allows me to further develop shapez.io ❤️ [/list] [img]{STEAM_APP_IMAGE}/extras/header_future_updates.png[/img] - I am updating the game very often and try to push an update at least every week! + I am updating the game very often and trying to push an update at least every week! [list] - [*] Different maps, and maybe map obstacles - [*] Story mode where buildings cost shapes - [*] Configurable map creation (Edit number and size of patches, seed, and more) - [*] More types of shapes - [*] More performance improvements (Although the game already runs pretty good!) + [*] Different maps and challenges (e.g. maps with obstacles) + [*] Puzzles (Deliver the requested shape with a restricted area / set of buildings) + [*] A story mode where buildings have a cost + [*] Configurable map generator (Configure resource/shape size/density, seed and more) + [*] Additional types of shapes + [*] Performance improvements (The game already runs pretty good!) [*] And much more! [/list] diff --git a/version b/version index 3a21f22a..867e5243 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.1.19 \ No newline at end of file +1.2.0 \ No newline at end of file