tobspr / shapez.io
- понедельник, 24 августа 2020 г. в 00:24:27
JavaScript
shapez.io is an open source base building game inspired by factorio! Available on web & desktop
This is the source code for shapez.io, an open source base building game inspired by Factorio. Your goal is to produce shapes by cutting, rotating, merging and painting parts of shapes.
#bugs
/ #feedback
/ #questions
on the Official Discord if you are not entirely sure if it's a bug etc.git lfs
extension is on your pathgit lfs pull
to download sound assetsffmpeg
is on your pathyarn
in the root foldergulp
folderyarn
and then yarn gulp
- it should now open in your browserNotice: This will produce a debug build with several debugging flags enabled. If you want to disable them, modify config.js
.
Please checkout the Translations readme.
Since this game is in the more or less early development, I will only accept pull requests which add an immediate benefit. Please understand that low quality PR's might be closed by me with a short comment explaining why.
If you want to add a new building, please understand that I can not simply add every building to the game! I recommend to talk to me before implementing anything, to make sure its actually useful. Otherwise there is a high chance of your PR not getting merged.
If you want to add a new feature or in generally contribute I recommend to get in touch with me on Discord:
The game is based on a custom engine which itself is based on the YORG.io 3 game engine (Actually it shares almost the same core). The code within the engine is relatively clean with some code for the actual game on top being hacky.
This project is based on ES5. Some ES2015 features are used but most of them are too slow, especially when polyfilled. For example, Array.prototype.forEach
is only used within non-critical loops since its slower than a plain for loop.
src/js/game/components/<name_lowercase>.js
MyFancyComponent
) which extends Component
static getId()
method which should return the CamelCaseName
without component (e.g. MyFancy
)static getSchema()
which should return the properties to be saved (See other components)new MyFancyComponent({})
should always work.src/js/game/component_registry.js
src/js/game/entity_components.js
(The easiest way is to copy an existing building)
src/js/game/buildings/<my_building.js>
MetaMyFancyBuilding extends MetaBuilding
setupEntityComponents
src/js/game/meta_building_registry.js
: You need to register it on the registry, and also call registerBuildingVariant
.src/js/game/hud/parts/buildings_toolbar.js
:supportedBuildings
src/js/game/key_action_mapper.js
in KEYMAPPINGS.buildings
translations/base-en.yaml
add it to two sections: buildings.[my_building].XXX
(See other buildings) and also keybindings.mappings.[my_building]
. Be sure to do it the same way as other buildings do!res/ui/buildings_icons
with the id of your buildingres/ui/building_tutorials
src/css/icons.scss
add your building to $buildings
as well as $buildingAndVariants
src/js/game/systems/<system_name>.js
GameSystemWithFilter
if you want it to work on certain entities only which have the given components. Otherwise use GameSystem
to do more generic stuff.update()
method.src/js/game/game_system_manager.js
(To this.systems
and also call add
in the internalInitSystems()
method)For most assets I use Adobe Photoshop, you can find them in assets/
.
You will need a Texture Packer license in order to regenerate the atlas. If you don't have one but want to contribute assets, let me know and I might compile it for you. I'm currently switching to an open source solution but I can't give an estimate when thats done.