1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2024-10-27 20:34:29 +00:00

Add constant signal emitters

This commit is contained in:
tobspr 2020-08-12 21:05:32 +02:00
parent c7b3cc1675
commit f4ac6dfe03
31 changed files with 1095 additions and 773 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 61 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1003 KiB

After

Width:  |  Height:  |  Size: 1.0 MiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 KiB

After

Width:  |  Height:  |  Size: 204 KiB

View File

@ -2,7 +2,7 @@
"sprites/belt/forward_0.png":
{
"frame": {"x":377,"y":841,"w":51,"h":63},
"frame": {"x":444,"y":697,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -10,7 +10,7 @@
},
"sprites/belt/forward_1.png":
{
"frame": {"x":377,"y":908,"w":51,"h":63},
"frame": {"x":499,"y":697,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -18,7 +18,7 @@
},
"sprites/belt/forward_2.png":
{
"frame": {"x":1045,"y":549,"w":51,"h":63},
"frame": {"x":1214,"y":271,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -26,7 +26,7 @@
},
"sprites/belt/forward_3.png":
{
"frame": {"x":749,"y":807,"w":51,"h":63},
"frame": {"x":891,"y":577,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -34,7 +34,7 @@
},
"sprites/belt/forward_4.png":
{
"frame": {"x":779,"y":580,"w":51,"h":63},
"frame": {"x":780,"y":685,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -42,7 +42,7 @@
},
"sprites/belt/forward_5.png":
{
"frame": {"x":834,"y":580,"w":51,"h":63},
"frame": {"x":780,"y":752,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -50,7 +50,7 @@
},
"sprites/belt/forward_6.png":
{
"frame": {"x":889,"y":569,"w":51,"h":63},
"frame": {"x":835,"y":692,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -58,7 +58,7 @@
},
"sprites/belt/forward_7.png":
{
"frame": {"x":804,"y":647,"w":51,"h":63},
"frame": {"x":835,"y":759,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -66,7 +66,7 @@
},
"sprites/belt/forward_8.png":
{
"frame": {"x":804,"y":714,"w":51,"h":63},
"frame": {"x":894,"y":644,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -74,7 +74,7 @@
},
"sprites/belt/forward_9.png":
{
"frame": {"x":804,"y":781,"w":51,"h":63},
"frame": {"x":890,"y":711,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -82,7 +82,7 @@
},
"sprites/belt/forward_10.png":
{
"frame": {"x":669,"y":606,"w":51,"h":63},
"frame": {"x":464,"y":764,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -90,7 +90,7 @@
},
"sprites/belt/forward_11.png":
{
"frame": {"x":1213,"y":314,"w":51,"h":63},
"frame": {"x":615,"y":699,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -98,7 +98,7 @@
},
"sprites/belt/forward_12.png":
{
"frame": {"x":639,"y":699,"w":51,"h":63},
"frame": {"x":519,"y":764,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -106,7 +106,7 @@
},
"sprites/belt/forward_13.png":
{
"frame": {"x":929,"y":502,"w":51,"h":63},
"frame": {"x":473,"y":831,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -114,7 +114,7 @@
},
"sprites/belt/forward_14.png":
{
"frame": {"x":984,"y":482,"w":51,"h":63},
"frame": {"x":528,"y":831,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -122,7 +122,7 @@
},
"sprites/belt/forward_15.png":
{
"frame": {"x":639,"y":766,"w":51,"h":63},
"frame": {"x":534,"y":898,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -130,7 +130,7 @@
},
"sprites/belt/forward_16.png":
{
"frame": {"x":639,"y":833,"w":51,"h":63},
"frame": {"x":670,"y":672,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -138,7 +138,7 @@
},
"sprites/belt/forward_17.png":
{
"frame": {"x":1039,"y":482,"w":51,"h":63},
"frame": {"x":1226,"y":70,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -146,7 +146,7 @@
},
"sprites/belt/forward_18.png":
{
"frame": {"x":1094,"y":481,"w":51,"h":63},
"frame": {"x":1226,"y":137,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -154,7 +154,7 @@
},
"sprites/belt/forward_19.png":
{
"frame": {"x":1149,"y":465,"w":51,"h":63},
"frame": {"x":1214,"y":204,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -162,7 +162,7 @@
},
"sprites/belt/forward_20.png":
{
"frame": {"x":1100,"y":548,"w":51,"h":63},
"frame": {"x":670,"y":739,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -170,7 +170,7 @@
},
"sprites/belt/forward_21.png":
{
"frame": {"x":1155,"y":532,"w":51,"h":63},
"frame": {"x":583,"y":827,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -178,7 +178,7 @@
},
"sprites/belt/forward_22.png":
{
"frame": {"x":724,"y":606,"w":51,"h":63},
"frame": {"x":589,"y":894,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -186,7 +186,7 @@
},
"sprites/belt/forward_23.png":
{
"frame": {"x":694,"y":673,"w":51,"h":63},
"frame": {"x":726,"y":605,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -194,7 +194,7 @@
},
"sprites/belt/forward_24.png":
{
"frame": {"x":694,"y":740,"w":51,"h":63},
"frame": {"x":725,"y":672,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -202,7 +202,7 @@
},
"sprites/belt/forward_25.png":
{
"frame": {"x":694,"y":807,"w":51,"h":63},
"frame": {"x":725,"y":739,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -210,7 +210,7 @@
},
"sprites/belt/forward_26.png":
{
"frame": {"x":749,"y":673,"w":51,"h":63},
"frame": {"x":781,"y":579,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -218,7 +218,7 @@
},
"sprites/belt/forward_27.png":
{
"frame": {"x":749,"y":740,"w":51,"h":63},
"frame": {"x":836,"y":579,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
@ -226,7 +226,7 @@
},
"sprites/belt/left_0.png":
{
"frame": {"x":1226,"y":70,"w":57,"h":57},
"frame": {"x":179,"y":962,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -234,7 +234,7 @@
},
"sprites/belt/left_1.png":
{
"frame": {"x":1226,"y":131,"w":57,"h":57},
"frame": {"x":554,"y":699,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -242,7 +242,7 @@
},
"sprites/belt/left_2.png":
{
"frame": {"x":859,"y":769,"w":57,"h":57},
"frame": {"x":1071,"y":641,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -250,7 +250,7 @@
},
"sprites/belt/left_3.png":
{
"frame": {"x":920,"y":697,"w":57,"h":57},
"frame": {"x":705,"y":867,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -258,7 +258,7 @@
},
"sprites/belt/left_4.png":
{
"frame": {"x":920,"y":758,"w":57,"h":57},
"frame": {"x":644,"y":928,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -266,7 +266,7 @@
},
"sprites/belt/left_5.png":
{
"frame": {"x":920,"y":819,"w":57,"h":57},
"frame": {"x":705,"y":928,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -274,7 +274,7 @@
},
"sprites/belt/left_6.png":
{
"frame": {"x":981,"y":610,"w":57,"h":57},
"frame": {"x":1152,"y":498,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -282,7 +282,7 @@
},
"sprites/belt/left_7.png":
{
"frame": {"x":981,"y":671,"w":57,"h":57},
"frame": {"x":1213,"y":498,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -290,7 +290,7 @@
},
"sprites/belt/left_8.png":
{
"frame": {"x":981,"y":732,"w":57,"h":57},
"frame": {"x":1168,"y":559,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -298,7 +298,7 @@
},
"sprites/belt/left_9.png":
{
"frame": {"x":981,"y":793,"w":57,"h":57},
"frame": {"x":1229,"y":559,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -306,7 +306,7 @@
},
"sprites/belt/left_10.png":
{
"frame": {"x":1226,"y":192,"w":57,"h":57},
"frame": {"x":473,"y":898,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -314,7 +314,7 @@
},
"sprites/belt/left_11.png":
{
"frame": {"x":432,"y":932,"w":57,"h":57},
"frame": {"x":469,"y":959,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -322,7 +322,7 @@
},
"sprites/belt/left_12.png":
{
"frame": {"x":1214,"y":253,"w":57,"h":57},
"frame": {"x":1213,"y":338,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -330,7 +330,7 @@
},
"sprites/belt/left_13.png":
{
"frame": {"x":494,"y":873,"w":57,"h":57},
"frame": {"x":574,"y":766,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -338,7 +338,7 @@
},
"sprites/belt/left_14.png":
{
"frame": {"x":555,"y":873,"w":57,"h":57},
"frame": {"x":890,"y":778,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -346,7 +346,7 @@
},
"sprites/belt/left_15.png":
{
"frame": {"x":493,"y":934,"w":57,"h":57},
"frame": {"x":946,"y":577,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -354,7 +354,7 @@
},
"sprites/belt/left_16.png":
{
"frame": {"x":554,"y":934,"w":57,"h":57},
"frame": {"x":949,"y":638,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -362,7 +362,7 @@
},
"sprites/belt/left_17.png":
{
"frame": {"x":984,"y":549,"w":57,"h":57},
"frame": {"x":1046,"y":580,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -370,7 +370,7 @@
},
"sprites/belt/left_18.png":
{
"frame": {"x":859,"y":647,"w":57,"h":57},
"frame": {"x":1107,"y":580,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -378,7 +378,7 @@
},
"sprites/belt/left_19.png":
{
"frame": {"x":859,"y":708,"w":57,"h":57},
"frame": {"x":1010,"y":641,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -386,7 +386,7 @@
},
"sprites/belt/left_20.png":
{
"frame": {"x":694,"y":874,"w":57,"h":57},
"frame": {"x":1132,"y":641,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -394,7 +394,7 @@
},
"sprites/belt/left_21.png":
{
"frame": {"x":755,"y":874,"w":57,"h":57},
"frame": {"x":949,"y":699,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -402,7 +402,7 @@
},
"sprites/belt/left_22.png":
{
"frame": {"x":859,"y":830,"w":57,"h":57},
"frame": {"x":1010,"y":702,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -410,7 +410,7 @@
},
"sprites/belt/left_23.png":
{
"frame": {"x":1213,"y":381,"w":57,"h":57},
"frame": {"x":1071,"y":702,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -418,7 +418,7 @@
},
"sprites/belt/left_24.png":
{
"frame": {"x":1215,"y":442,"w":57,"h":57},
"frame": {"x":1132,"y":702,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -426,7 +426,7 @@
},
"sprites/belt/left_25.png":
{
"frame": {"x":1215,"y":503,"w":57,"h":57},
"frame": {"x":638,"y":806,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -434,7 +434,7 @@
},
"sprites/belt/left_26.png":
{
"frame": {"x":1210,"y":564,"w":57,"h":57},
"frame": {"x":699,"y":806,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -442,7 +442,7 @@
},
"sprites/belt/left_27.png":
{
"frame": {"x":920,"y":636,"w":57,"h":57},
"frame": {"x":644,"y":867,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -450,7 +450,7 @@
},
"sprites/belt/right_0.png":
{
"frame": {"x":1042,"y":616,"w":57,"h":57},
"frame": {"x":1193,"y":620,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -458,7 +458,7 @@
},
"sprites/belt/right_1.png":
{
"frame": {"x":1042,"y":677,"w":57,"h":57},
"frame": {"x":1193,"y":681,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -466,7 +466,7 @@
},
"sprites/belt/right_2.png":
{
"frame": {"x":1042,"y":860,"w":57,"h":57},
"frame": {"x":949,"y":839,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -474,7 +474,7 @@
},
"sprites/belt/right_3.png":
{
"frame": {"x":1225,"y":686,"w":57,"h":57},
"frame": {"x":1010,"y":946,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -482,7 +482,7 @@
},
"sprites/belt/right_4.png":
{
"frame": {"x":1225,"y":747,"w":57,"h":57},
"frame": {"x":1071,"y":885,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -490,7 +490,7 @@
},
"sprites/belt/right_5.png":
{
"frame": {"x":1225,"y":808,"w":57,"h":57},
"frame": {"x":1132,"y":824,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -498,7 +498,7 @@
},
"sprites/belt/right_6.png":
{
"frame": {"x":1225,"y":869,"w":57,"h":57},
"frame": {"x":1193,"y":803,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -506,7 +506,7 @@
},
"sprites/belt/right_7.png":
{
"frame": {"x":1225,"y":930,"w":57,"h":57},
"frame": {"x":1071,"y":946,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -514,7 +514,7 @@
},
"sprites/belt/right_8.png":
{
"frame": {"x":616,"y":900,"w":57,"h":57},
"frame": {"x":1132,"y":885,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -522,7 +522,7 @@
},
"sprites/belt/right_9.png":
{
"frame": {"x":677,"y":935,"w":57,"h":57},
"frame": {"x":1193,"y":864,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -530,7 +530,7 @@
},
"sprites/belt/right_10.png":
{
"frame": {"x":1042,"y":738,"w":57,"h":57},
"frame": {"x":1193,"y":742,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -538,7 +538,7 @@
},
"sprites/belt/right_11.png":
{
"frame": {"x":1042,"y":799,"w":57,"h":57},
"frame": {"x":766,"y":819,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -546,7 +546,7 @@
},
"sprites/belt/right_12.png":
{
"frame": {"x":1103,"y":615,"w":57,"h":57},
"frame": {"x":766,"y":880,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -554,7 +554,7 @@
},
"sprites/belt/right_13.png":
{
"frame": {"x":1103,"y":676,"w":57,"h":57},
"frame": {"x":827,"y":826,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -562,7 +562,7 @@
},
"sprites/belt/right_14.png":
{
"frame": {"x":1103,"y":737,"w":57,"h":57},
"frame": {"x":827,"y":887,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -570,7 +570,7 @@
},
"sprites/belt/right_15.png":
{
"frame": {"x":1103,"y":798,"w":57,"h":57},
"frame": {"x":888,"y":839,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -578,7 +578,7 @@
},
"sprites/belt/right_16.png":
{
"frame": {"x":1164,"y":657,"w":57,"h":57},
"frame": {"x":766,"y":941,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -586,7 +586,7 @@
},
"sprites/belt/right_17.png":
{
"frame": {"x":1164,"y":718,"w":57,"h":57},
"frame": {"x":827,"y":948,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -594,7 +594,7 @@
},
"sprites/belt/right_18.png":
{
"frame": {"x":1164,"y":779,"w":57,"h":57},
"frame": {"x":888,"y":900,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -602,7 +602,7 @@
},
"sprites/belt/right_19.png":
{
"frame": {"x":981,"y":854,"w":57,"h":57},
"frame": {"x":888,"y":961,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -610,7 +610,7 @@
},
"sprites/belt/right_20.png":
{
"frame": {"x":1103,"y":859,"w":57,"h":57},
"frame": {"x":949,"y":900,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -618,7 +618,7 @@
},
"sprites/belt/right_21.png":
{
"frame": {"x":1164,"y":840,"w":57,"h":57},
"frame": {"x":949,"y":961,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -626,7 +626,7 @@
},
"sprites/belt/right_22.png":
{
"frame": {"x":920,"y":880,"w":57,"h":57},
"frame": {"x":1010,"y":763,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -634,7 +634,7 @@
},
"sprites/belt/right_23.png":
{
"frame": {"x":981,"y":915,"w":57,"h":57},
"frame": {"x":1071,"y":763,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -642,7 +642,7 @@
},
"sprites/belt/right_24.png":
{
"frame": {"x":1042,"y":921,"w":57,"h":57},
"frame": {"x":1132,"y":763,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -650,7 +650,7 @@
},
"sprites/belt/right_25.png":
{
"frame": {"x":1103,"y":920,"w":57,"h":57},
"frame": {"x":1010,"y":824,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -658,7 +658,7 @@
},
"sprites/belt/right_26.png":
{
"frame": {"x":1164,"y":901,"w":57,"h":57},
"frame": {"x":1010,"y":885,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -666,7 +666,7 @@
},
"sprites/belt/right_27.png":
{
"frame": {"x":1225,"y":625,"w":57,"h":57},
"frame": {"x":1071,"y":824,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -674,7 +674,7 @@
},
"sprites/blueprints/belt_left.png":
{
"frame": {"x":1149,"y":403,"w":58,"h":58},
"frame": {"x":278,"y":961,"w":58,"h":58},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":5,"w":58,"h":58},
@ -682,7 +682,7 @@
},
"sprites/blueprints/belt_right.png":
{
"frame": {"x":432,"y":870,"w":58,"h":58},
"frame": {"x":340,"y":961,"w":58,"h":58},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":5,"y":5,"w":58,"h":58},
@ -690,12 +690,20 @@
},
"sprites/blueprints/belt_top.png":
{
"frame": {"x":1221,"y":3,"w":53,"h":63},
"frame": {"x":669,"y":605,"w":53,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":5,"y":0,"w":53,"h":63},
"sourceSize": {"w":63,"h":63}
},
"sprites/blueprints/constant_signal.png":
{
"frame": {"x":476,"y":599,"w":93,"h":94},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":2,"y":2,"w":93,"h":94},
"sourceSize": {"w":96,"h":96}
},
"sprites/blueprints/cutter-quad.png":
{
"frame": {"x":3,"y":374,"w":366,"h":96},
@ -722,7 +730,7 @@
},
"sprites/blueprints/miner.png":
{
"frame": {"x":670,"y":467,"w":92,"h":96},
"frame": {"x":377,"y":853,"w":92,"h":96},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":3,"y":0,"w":92,"h":96},
@ -802,7 +810,7 @@
},
"sprites/blueprints/splitter-compact.png":
{
"frame": {"x":476,"y":599,"w":93,"h":93},
"frame": {"x":765,"y":403,"w":93,"h":93},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":3,"y":1,"w":93,"h":93},
@ -850,7 +858,7 @@
},
"sprites/blueprints/underground_belt_entry.png":
{
"frame": {"x":531,"y":794,"w":93,"h":75},
"frame": {"x":765,"y":500,"w":93,"h":75},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":2,"y":21,"w":93,"h":75},
@ -858,7 +866,7 @@
},
"sprites/blueprints/underground_belt_exit-tier2.png":
{
"frame": {"x":433,"y":791,"w":94,"h":75},
"frame": {"x":366,"y":774,"w":94,"h":75},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":2,"y":0,"w":94,"h":75},
@ -866,7 +874,7 @@
},
"sprites/blueprints/underground_belt_exit.png":
{
"frame": {"x":956,"y":403,"w":93,"h":75},
"frame": {"x":862,"y":498,"w":93,"h":75},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":2,"y":0,"w":93,"h":75},
@ -874,7 +882,7 @@
},
"sprites/blueprints/wire-cross.png":
{
"frame": {"x":366,"y":774,"w":63,"h":63},
"frame": {"x":1221,"y":3,"w":63,"h":63},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":63,"h":63},
@ -882,7 +890,7 @@
},
"sprites/blueprints/wire-split.png":
{
"frame": {"x":670,"y":567,"w":63,"h":35},
"frame": {"x":670,"y":566,"w":63,"h":35},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":28,"w":63,"h":35},
@ -890,7 +898,7 @@
},
"sprites/blueprints/wire-turn.png":
{
"frame": {"x":944,"y":569,"w":35,"h":35},
"frame": {"x":1007,"y":576,"w":35,"h":35},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":28,"y":28,"w":35,"h":35},
@ -898,7 +906,7 @@
},
"sprites/blueprints/wire.png":
{
"frame": {"x":628,"y":794,"w":7,"h":63},
"frame": {"x":373,"y":399,"w":7,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":28,"y":0,"w":7,"h":63},
@ -906,7 +914,7 @@
},
"sprites/buildings/belt_left.png":
{
"frame": {"x":738,"y":935,"w":57,"h":57},
"frame": {"x":1132,"y":946,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":6,"w":57,"h":57},
@ -914,7 +922,7 @@
},
"sprites/buildings/belt_right.png":
{
"frame": {"x":799,"y":935,"w":57,"h":57},
"frame": {"x":1193,"y":925,"w":57,"h":57},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":6,"w":57,"h":57},
@ -922,12 +930,20 @@
},
"sprites/buildings/belt_top.png":
{
"frame": {"x":377,"y":841,"w":51,"h":63},
"frame": {"x":444,"y":697,"w":51,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":51,"h":63},
"sourceSize": {"w":63,"h":63}
},
"sprites/buildings/constant_signal.png":
{
"frame": {"x":1152,"y":403,"w":90,"h":91},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":4,"y":4,"w":90,"h":91},
"sourceSize": {"w":96,"h":96}
},
"sprites/buildings/cutter-quad.png":
{
"frame": {"x":751,"y":3,"w":366,"h":96},
@ -954,7 +970,7 @@
},
"sprites/buildings/miner-chainable.png":
{
"frame": {"x":766,"y":403,"w":91,"h":95},
"frame": {"x":670,"y":467,"w":91,"h":95},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":3,"y":0,"w":91,"h":95},
@ -962,7 +978,7 @@
},
"sprites/buildings/miner.png":
{
"frame": {"x":861,"y":403,"w":91,"h":95},
"frame": {"x":1057,"y":403,"w":91,"h":95},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":3,"y":0,"w":91,"h":95},
@ -1034,7 +1050,7 @@
},
"sprites/buildings/splitter-compact-inverse.png":
{
"frame": {"x":444,"y":696,"w":94,"h":91},
"frame": {"x":862,"y":403,"w":94,"h":91},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":2,"w":94,"h":91},
@ -1042,7 +1058,7 @@
},
"sprites/buildings/splitter-compact.png":
{
"frame": {"x":542,"y":699,"w":93,"h":91},
"frame": {"x":960,"y":403,"w":93,"h":91},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":3,"y":2,"w":93,"h":91},
@ -1098,7 +1114,7 @@
},
"sprites/buildings/underground_belt_exit-tier2.png":
{
"frame": {"x":1053,"y":403,"w":92,"h":74},
"frame": {"x":959,"y":498,"w":92,"h":74},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":3,"y":0,"w":92,"h":74},
@ -1106,7 +1122,7 @@
},
"sprites/buildings/underground_belt_exit.png":
{
"frame": {"x":766,"y":502,"w":92,"h":74},
"frame": {"x":1055,"y":502,"w":92,"h":74},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":3,"y":0,"w":92,"h":74},
@ -1114,7 +1130,7 @@
},
"sprites/buildings/wire-cross.png":
{
"frame": {"x":862,"y":502,"w":63,"h":63},
"frame": {"x":402,"y":953,"w":63,"h":63},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":63,"h":63},
@ -1122,7 +1138,7 @@
},
"sprites/buildings/wire-split.png":
{
"frame": {"x":188,"y":962,"w":63,"h":35},
"frame": {"x":781,"y":646,"w":63,"h":35},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":28,"w":63,"h":35},
@ -1130,7 +1146,7 @@
},
"sprites/buildings/wire-turn.png":
{
"frame": {"x":615,"y":961,"w":35,"h":35},
"frame": {"x":1254,"y":620,"w":35,"h":35},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":28,"y":28,"w":35,"h":35},
@ -1138,7 +1154,7 @@
},
"sprites/buildings/wire.png":
{
"frame": {"x":1204,"y":465,"w":7,"h":63},
"frame": {"x":384,"y":399,"w":7,"h":63},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":28,"y":0,"w":7,"h":63},
@ -1146,7 +1162,7 @@
},
"sprites/debug/acceptor_slot.png":
{
"frame": {"x":1103,"y":981,"w":26,"h":32},
"frame": {"x":240,"y":962,"w":26,"h":32},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":3,"y":0,"w":26,"h":32},
@ -1154,7 +1170,7 @@
},
"sprites/debug/ejector_slot.png":
{
"frame": {"x":1133,"y":981,"w":26,"h":32},
"frame": {"x":142,"y":965,"w":26,"h":32},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":3,"y":0,"w":26,"h":32},
@ -1162,7 +1178,7 @@
},
"sprites/misc/deletion_marker.png":
{
"frame": {"x":142,"y":965,"w":42,"h":42},
"frame": {"x":848,"y":646,"w":42,"h":42},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":3,"y":3,"w":42,"h":42},
@ -1170,7 +1186,7 @@
},
"sprites/misc/hub_direction_indicator.png":
{
"frame": {"x":956,"y":482,"w":16,"h":16},
"frame": {"x":348,"y":674,"w":16,"h":16},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":16,"h":16},
@ -1178,7 +1194,7 @@
},
"sprites/misc/slot_bad_arrow.png":
{
"frame": {"x":142,"y":965,"w":42,"h":42},
"frame": {"x":848,"y":646,"w":42,"h":42},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":3,"y":3,"w":42,"h":42},
@ -1186,7 +1202,7 @@
},
"sprites/misc/slot_good_arrow.png":
{
"frame": {"x":3,"y":965,"w":42,"h":48},
"frame": {"x":530,"y":965,"w":42,"h":48},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":3,"y":0,"w":42,"h":48},
@ -1216,9 +1232,25 @@
"spriteSourceSize": {"x":0,"y":0,"w":64,"h":64},
"sourceSize": {"w":64,"h":64}
},
"sprites/wires/boolean_false.png":
{
"frame": {"x":737,"y":566,"w":16,"h":22},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":8,"y":6,"w":16,"h":22},
"sourceSize": {"w":32,"h":32}
},
"sprites/wires/boolean_true.png":
{
"frame": {"x":1254,"y":659,"w":12,"h":24},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":9,"y":5,"w":12,"h":24},
"sourceSize": {"w":32,"h":32}
},
"sprites/wires/logical_acceptor.png":
{
"frame": {"x":255,"y":962,"w":26,"h":30},
"frame": {"x":635,"y":766,"w":26,"h":30},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":19,"y":0,"w":26,"h":30},
@ -1226,7 +1258,7 @@
},
"sprites/wires/logical_ejector.png":
{
"frame": {"x":1164,"y":599,"w":42,"h":54},
"frame": {"x":3,"y":965,"w":42,"h":54},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":11,"y":0,"w":42,"h":54},
@ -1237,8 +1269,8 @@
"version": "1.0",
"image": "atlas0_50.png",
"format": "RGBA8888",
"size": {"w":1286,"h":1016},
"size": {"w":1292,"h":1022},
"scale": "0.5",
"smartupdate": "$TexturePacker:SmartUpdate:06c248b9dcecff13f7dfba53c89495d3:f53ce8a47bd52d5fdc10e7c53c031305:f159918d23e5952766c6d23ab52278c6$"
"smartupdate": "$TexturePacker:SmartUpdate:5ea7dd209dcb03961a072825a642d749:280ec47ed970a752639cdd30bf29dca4:f159918d23e5952766c6d23ab52278c6$"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 492 KiB

After

Width:  |  Height:  |  Size: 485 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 956 KiB

After

Width:  |  Height:  |  Size: 962 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -5,11 +5,7 @@ import { BasicSerializableObject } from "../savegame/serialization";
export const enumItemType = {
shape: "shape",
color: "color",
positiveEnergy: "positiveEnergy",
negativeEnergy: "negativeEnergy",
// Can be used for filters
genericEnergy: "genericEnergy",
boolean: "boolean",
};
/**

View File

@ -0,0 +1,51 @@
import { enumDirection, Vector } from "../../core/vector";
import { enumPinSlotType, WiredPinsComponent } from "../components/wired_pins";
import { Entity } from "../entity";
import { MetaBuilding } from "../meta_building";
import { enumLayer, GameRoot } from "../root";
import { ConstantSignalComponent } from "../components/constant_signal";
export class MetaConstantSignalBuilding extends MetaBuilding {
constructor() {
super("constant_signal");
}
getSilhouetteColor() {
return "#2bafda";
}
/**
* @param {GameRoot} root
*/
getIsUnlocked(root) {
// @todo
return G_IS_DEV;
}
getLayer() {
return enumLayer.wires;
}
getDimensions() {
return new Vector(1, 1);
}
/**
* Creates the entity at the given location
* @param {Entity} entity
*/
setupEntityComponents(entity) {
entity.addComponent(
new WiredPinsComponent({
slots: [
{
pos: new Vector(0, 0),
direction: enumDirection.top,
type: enumPinSlotType.logicalEjector,
},
],
})
);
entity.addComponent(new ConstantSignalComponent({}));
}
}

View File

@ -11,6 +11,7 @@ import { StorageComponent } from "./components/storage";
import { WiredPinsComponent } from "./components/wired_pins";
import { BeltUnderlaysComponent } from "./components/belt_underlays";
import { WireComponent } from "./components/wire";
import { ConstantSignalComponent } from "./components/constant_signal";
export function initComponentRegistry() {
gComponentRegistry.register(StaticMapEntityComponent);
@ -25,6 +26,7 @@ export function initComponentRegistry() {
gComponentRegistry.register(WiredPinsComponent);
gComponentRegistry.register(BeltUnderlaysComponent);
gComponentRegistry.register(WireComponent);
gComponentRegistry.register(ConstantSignalComponent);
// IMPORTANT ^^^^^ UPDATE ENTITY COMPONENT STORAGE AFTERWARDS

View File

@ -0,0 +1,30 @@
import { gItemRegistry } from "../../core/global_registries";
import { types } from "../../savegame/serialization";
import { Component } from "../component";
import { BaseItem } from "../base_item";
export class ConstantSignalComponent extends Component {
static getId() {
return "ConstantSignal";
}
static getSchema() {
return {
signal: types.nullable(types.obj(gItemRegistry)),
};
}
duplicateWithoutContents() {
return new ConstantSignalComponent({ signal: this.signal });
}
/**
*
* @param {object} param0
* @param {BaseItem=} param0.signal The signal to store
*/
constructor({ signal = null }) {
super();
this.signal = signal;
}
}

View File

@ -87,25 +87,7 @@ export class ItemAcceptorComponent extends Component {
*/
canAcceptItem(slotIndex, item) {
const slot = this.slots[slotIndex];
return this.filterMatches(slot.filter, item);
}
/**
* Returns if the given filter matches
* @param {enumItemType|null} filter
* @param {BaseItem} item
*/
filterMatches(filter, item) {
if (!filter) {
return true;
}
const itemType = item.getItemType();
if (filter === enumItemType.genericEnergy) {
return itemType === enumItemType.positiveEnergy || itemType === enumItemType.negativeEnergy;
}
return itemType === filter;
return !slot.filter || slot.filter === item.getItemType();
}
/**

View File

@ -11,6 +11,7 @@ import { StorageComponent } from "./components/storage";
import { UndergroundBeltComponent } from "./components/underground_belt";
import { WiredPinsComponent } from "./components/wired_pins";
import { WireComponent } from "./components/wire";
import { ConstantSignalComponent } from "./components/constant_signal";
/* typehints:end */
/**
@ -57,6 +58,9 @@ export class EntityComponentStorage {
/** @type {WireComponent} */
this.Wire;
/** @type {ConstantSignalComponent} */
this.ConstantSignal;
/* typehints:end */
}
}

View File

@ -16,6 +16,7 @@ import { StorageSystem } from "./systems/storage";
import { WiredPinsSystem } from "./systems/wired_pins";
import { BeltUnderlaysSystem } from "./systems/belt_underlays";
import { WireSystem } from "./systems/wire";
import { ConstantSignalSystem } from "./systems/constant_signal";
const logger = createLogger("game_system_manager");
@ -68,6 +69,9 @@ export class GameSystemManager {
/** @type {WireSystem} */
wire: null,
/** @type {ConstantSignalSystem} */
constantSignal: null,
/* typehints:end */
};
this.systemUpdateOrder = [];
@ -108,6 +112,8 @@ export class GameSystemManager {
add("beltUnderlays", BeltUnderlaysSystem);
add("constantSignal", ConstantSignalSystem);
// IMPORTANT: Must be after belt system since belt system can change the
// orientation of an entity after it is placed -> the item acceptor cache
// then would be invalid

View File

@ -1,8 +1,9 @@
import { enumLayer } from "../../root";
import { HUDBaseToolbar } from "./base_toolbar";
import { MetaWireBuilding } from "../../buildings/wire";
import { MetaConstantSignalBuilding } from "../../buildings/constant_signal";
const supportedBuildings = [MetaWireBuilding];
const supportedBuildings = [MetaWireBuilding, MetaConstantSignalBuilding];
export class HUDWiresToolbar extends HUDBaseToolbar {
constructor(root) {

View File

@ -1,12 +1,10 @@
import { gItemRegistry } from "../core/global_registries";
import { ShapeItem } from "./items/shape_item";
import { ColorItem } from "./items/color_item";
import { PositiveEnergyItem } from "./items/positive_energy_item";
import { NegativeEnergyItem } from "./items/negative_energy_item";
import { BooleanItem } from "./items/boolean_item";
export function initItemRegistry() {
gItemRegistry.register(ShapeItem);
gItemRegistry.register(ColorItem);
gItemRegistry.register(PositiveEnergyItem);
gItemRegistry.register(NegativeEnergyItem);
gItemRegistry.register(BooleanItem);
}

View File

@ -0,0 +1,53 @@
import { DrawParameters } from "../../core/draw_parameters";
import { Loader } from "../../core/loader";
import { types } from "../../savegame/serialization";
import { BaseItem, enumItemType } from "../base_item";
export class BooleanItem extends BaseItem {
static getId() {
return "boolean_item";
}
static getSchema() {
return types.uint;
}
serialize() {
return this.value;
}
deserialize(data) {
this.value = data;
}
getItemType() {
return enumItemType.boolean;
}
/**
* @param {number} value
*/
constructor(value) {
super();
this.value = value ? 1 : 0;
}
/**
* @param {number} x
* @param {number} y
* @param {number} size
* @param {DrawParameters} parameters
*/
draw(x, y, parameters, size = 12) {
let sprite;
if (this.value) {
sprite = Loader.getSprite("sprites/wires/boolean_true.png");
} else {
sprite = Loader.getSprite("sprites/wires/boolean_false.png");
}
sprite.drawCachedCentered(parameters, x, y, size * 1.5);
}
}
export const BOOL_FALSE_SINGLETON = new BooleanItem(0);
export const BOOL_TRUE_SINGLETON = new BooleanItem(1);

View File

@ -1,37 +0,0 @@
import { DrawParameters } from "../../core/draw_parameters";
import { Loader } from "../../core/loader";
import { types } from "../../savegame/serialization";
import { BaseItem, enumItemType } from "../base_item";
export class NegativeEnergyItem extends BaseItem {
static getId() {
return "negative_energy";
}
static getSchema() {
return types.uint;
}
serialize() {
return 0;
}
deserialize(data) {}
getItemType() {
return enumItemType.negativeEnergy;
}
/**
* @param {number} x
* @param {number} y
* @param {number} size
* @param {DrawParameters} parameters
*/
draw(x, y, parameters, size = 12) {
const sprite = Loader.getSprite("sprites/wires/negative_energy.png");
sprite.drawCachedCentered(parameters, x, y, size * 1.5);
}
}
export const NEGATIVE_ENERGY_ITEM_SINGLETON = new NegativeEnergyItem();

View File

@ -1,37 +0,0 @@
import { DrawParameters } from "../../core/draw_parameters";
import { Loader } from "../../core/loader";
import { types } from "../../savegame/serialization";
import { BaseItem, enumItemType } from "../base_item";
export class PositiveEnergyItem extends BaseItem {
static getId() {
return "positive_energy";
}
static getSchema() {
return types.uint;
}
serialize() {
return 0;
}
deserialize(data) {}
getItemType() {
return enumItemType.positiveEnergy;
}
/**
* @param {number} x
* @param {number} y
* @param {number} size
* @param {DrawParameters} parameters
*/
draw(x, y, parameters, size = 12) {
const sprite = Loader.getSprite("sprites/wires/positive_energy.png");
sprite.drawCachedCentered(parameters, x, y, size * 1.5);
}
}
export const POSITIVE_ENERGY_ITEM_SINGLETON = new PositiveEnergyItem();

View File

@ -56,6 +56,7 @@ export const KEYMAPPINGS = {
trash: { keyCode: key("0") },
wire: { keyCode: key("1") },
constant_signal: { keyCode: key("2") },
},
placement: {

View File

@ -15,6 +15,7 @@ import { enumUndergroundBeltVariants, MetaUndergroundBeltBuilding } from "./buil
import { MetaWireBuilding } from "./buildings/wire";
import { gBuildingVariants, registerBuildingVariant } from "./building_codes";
import { defaultBuildingVariant } from "./meta_building";
import { MetaConstantSignalBuilding } from "./buildings/constant_signal";
const logger = createLogger("building_registry");
@ -31,6 +32,7 @@ export function initMetaBuildingRegistry() {
gMetaBuildingRegistry.register(MetaUndergroundBeltBuilding);
gMetaBuildingRegistry.register(MetaHubBuilding);
gMetaBuildingRegistry.register(MetaWireBuilding);
gMetaBuildingRegistry.register(MetaConstantSignalBuilding);
// Belt
registerBuildingVariant(1, MetaBeltBaseBuilding, defaultBuildingVariant, 0);
@ -86,6 +88,9 @@ export function initMetaBuildingRegistry() {
registerBuildingVariant(29, MetaWireBuilding, defaultBuildingVariant, 2);
registerBuildingVariant(30, MetaWireBuilding, defaultBuildingVariant, 3);
// Constant signal
registerBuildingVariant(31, MetaConstantSignalBuilding);
// Propagate instances
for (const key in gBuildingVariants) {
gBuildingVariants[key].metaInstance = gMetaBuildingRegistry.findByClass(

View File

@ -0,0 +1,98 @@
import { ConstantSignalComponent } from "../components/constant_signal";
import { GameSystemWithFilter } from "../game_system_with_filter";
import { Entity } from "../entity";
import { DialogWithForm } from "../../core/modal_dialog_elements";
import { FormElementInput } from "../../core/modal_dialog_forms";
import { enumColors } from "../colors";
import { ColorItem } from "../items/color_item";
import trim from "trim";
import { BOOL_TRUE_SINGLETON, BOOL_FALSE_SINGLETON } from "../items/boolean_item";
import { ShapeDefinition } from "../shape_definition";
import { ShapeItem } from "../items/shape_item";
export class ConstantSignalSystem extends GameSystemWithFilter {
constructor(root) {
super(root, [ConstantSignalComponent]);
this.root.signals.entityManuallyPlaced.add(this.querySigalValue, this);
}
update() {
// Set signals
for (let i = 0; i < this.allEntities.length; ++i) {
const entity = this.allEntities[i];
const pinsComp = entity.components.WiredPins;
const signalComp = entity.components.ConstantSignal;
pinsComp.slots[0].value = signalComp.signal;
}
}
/**
* Asks the entity to enter a valid signal code
* @param {Entity} entity
*/
querySigalValue(entity) {
if (!entity.components.ConstantSignal) {
return;
}
// Ok, query, but also save the uid because it could get stale
const uid = entity.uid;
const signalValueInput = new FormElementInput({
id: "markerName",
label: null,
placeholder: "",
defaultValue: "",
validator: val => this.parseSignalCode(val),
});
const dialog = new DialogWithForm({
app: this.root.app,
title: "Set Signal",
desc: "Enter a shape code, color or '0' or '1'",
formElements: [signalValueInput],
buttons: ["cancel", "ok:good"],
});
this.root.hud.parts.dialogs.internalShowDialog(dialog);
dialog.buttonSignals.ok.add(() => {
if (!this.root || !this.root.entityMgr) {
// Game got stopped
return;
}
const entityRef = this.root.entityMgr.findByUid(uid, false);
if (!entityRef) {
// outdated
return;
}
const constantComp = entityRef.components.ConstantSignal;
if (!constantComp) {
// no longer interesting
return;
}
constantComp.signal = this.parseSignalCode(signalValueInput.getValue());
});
}
parseSignalCode(code) {
code = trim(code);
if (enumColors[code]) {
return new ColorItem(code);
}
if (code === "1" || code === "true") {
return BOOL_TRUE_SINGLETON;
}
if (code === "0" || code === "false") {
return BOOL_FALSE_SINGLETON;
}
if (ShapeDefinition.isValidShortKey(code)) {
return new ShapeItem(this.root.shapeDefinitionMgr.getShapeFromShortKey(code));
}
return null;
}
}

View File

@ -183,7 +183,7 @@ export class WiredPinsSystem extends GameSystemWithFilter {
// Draw contained item to visualize whats emitted
const value = slot.value;
if (value) {
value.draw(worldPos.x, worldPos.y, parameters, 12);
value.draw(worldPos.x, worldPos.y, parameters, 10);
}
}
}

View File

@ -550,6 +550,11 @@ buildings:
name: *wire
description: &wire_desc
constant_signal:
default:
name: &constant_signal Constant Signal
description: Emits a constant signal (shape, color or boolean).
storyRewards:
# Those are the rewards gained from completing the store
reward_cutter_and_trash:
@ -805,6 +810,8 @@ keybindings:
toggleFPSInfo: Toggle FPS and Debug Info
switchLayers: Switch layers
exportScreenshot: Export whole Base as Image
# --- Do not translate the values in this section
belt: *belt
splitter: *splitter
underground_belt: *underground_belt
@ -816,6 +823,8 @@ keybindings:
painter: *painter
trash: *trash
wire: *wire
constant_signal: *constant_signal
# ---
pipette: Pipette
rotateWhilePlacing: Rotate