1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Add belt rendering (very slow for now)

This commit is contained in:
tobspr
2020-06-26 17:28:19 +02:00
parent a71c0b8039
commit e594b6a4a7
3 changed files with 44 additions and 20 deletions

View File

@@ -227,7 +227,9 @@ export class BeltSystem extends GameSystemWithFilter {
}
draw(parameters) {
this.forEachMatchingEntityOnScreen(parameters, this.drawEntityItems.bind(this));
for (let i = 0; i < this.beltPaths.length; ++i) {
this.beltPaths[i].draw(parameters);
}
}
/**

View File

@@ -239,9 +239,9 @@ export class ItemEjectorSystem extends GameSystemWithFilter {
const beltComp = receiver.components.Belt;
if (beltComp) {
// Ayy, its a belt!
if (beltComp.canAcceptItem()) {
beltComp.takeItem(item);
const path = beltComp.assignedPath;
assert(path, "belt has no path");
if (path.tryAcceptItem(item)) {
return true;
}
}