diff --git a/core/assets/sprites/sprites.atlas b/core/assets/sprites/sprites.atlas index 8828cba6e3..f1f4d17a0e 100644 --- a/core/assets/sprites/sprites.atlas +++ b/core/assets/sprites/sprites.atlas @@ -27,49 +27,49 @@ blocks/blackrock1 index: -1 blocks/blackrockshadow1 rotate: false - xy: 195, 75 + xy: 315, 91 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/blackstone1 rotate: false - xy: 205, 75 + xy: 315, 81 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/blackstone2 rotate: false - xy: 215, 75 + xy: 325, 91 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/blackstone3 rotate: false - xy: 225, 75 + xy: 325, 81 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/blackstoneblock1 rotate: false - xy: 235, 75 + xy: 335, 91 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/blackstoneblock2 rotate: false - xy: 245, 75 + xy: 335, 81 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/blackstoneblock3 rotate: false - xy: 255, 75 + xy: 345, 91 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -83,7 +83,7 @@ blocks/blackstoneedge index: -1 blocks/block rotate: false - xy: 275, 75 + xy: 355, 91 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -111,119 +111,119 @@ blocks/chainturret index: -1 blocks/chainturret-icon rotate: false - xy: 109, 65 + xy: 123, 79 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/coal1 rotate: false - xy: 295, 75 + xy: 193, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coal2 rotate: false - xy: 531, 136 + xy: 203, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coal3 rotate: false - xy: 527, 126 + xy: 213, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coaldrill rotate: false - xy: 524, 107 + xy: 223, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coalgenerator rotate: false - xy: 305, 79 + xy: 233, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coalgenerator-top rotate: false - xy: 315, 79 + xy: 243, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coalpurifier rotate: false - xy: 325, 79 + xy: 253, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/combustiongenerator rotate: false - xy: 335, 79 + xy: 263, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/compositewall rotate: false - xy: 345, 79 + xy: 273, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conduit rotate: false - xy: 355, 79 + xy: 283, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conduitbottom rotate: false - xy: 365, 83 + xy: 293, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conduitliquid rotate: false - xy: 375, 83 + xy: 303, 67 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conduittop rotate: false - xy: 385, 83 + xy: 531, 136 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conveyor rotate: false - xy: 395, 83 + xy: 527, 126 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conveyormove rotate: false - xy: 405, 83 + xy: 365, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conveyortunnel rotate: false - xy: 415, 83 + xy: 365, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -237,42 +237,42 @@ blocks/core index: -1 blocks/cross rotate: false - xy: 425, 83 + xy: 375, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/crucible rotate: false - xy: 435, 83 + xy: 375, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/deepwater rotate: false - xy: 445, 83 + xy: 385, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/dirt1 rotate: false - xy: 455, 83 + xy: 385, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/dirt2 rotate: false - xy: 465, 83 + xy: 395, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/dirt3 rotate: false - xy: 475, 83 + xy: 395, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -286,7 +286,7 @@ blocks/dirtedge index: -1 blocks/door rotate: false - xy: 786, 393 + xy: 405, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -300,7 +300,7 @@ blocks/door-large index: -1 blocks/door-large-icon rotate: false - xy: 796, 393 + xy: 405, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -314,21 +314,21 @@ blocks/door-large-open index: -1 blocks/door-open rotate: false - xy: 844, 485 + xy: 415, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/doubleturret rotate: false - xy: 109, 53 + xy: 123, 67 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/duriumwall rotate: false - xy: 854, 485 + xy: 415, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -342,14 +342,14 @@ blocks/duriumwall-large index: -1 blocks/duriumwall-large-icon rotate: false - xy: 864, 485 + xy: 425, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/enemyspawn rotate: false - xy: 874, 485 + xy: 425, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -363,42 +363,42 @@ blocks/flameturret index: -1 blocks/fluxpump rotate: false - xy: 894, 485 + xy: 435, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grass1 rotate: false - xy: 904, 485 + xy: 445, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grass2 rotate: false - xy: 914, 485 + xy: 445, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grass3 rotate: false - xy: 924, 485 + xy: 455, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grassblock1 rotate: false - xy: 934, 485 + xy: 455, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grassblock2 rotate: false - xy: 944, 485 + xy: 465, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -412,21 +412,21 @@ blocks/grassedge index: -1 blocks/ice1 rotate: false - xy: 954, 485 + xy: 465, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/ice2 rotate: false - xy: 964, 485 + xy: 475, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/ice3 rotate: false - xy: 974, 485 + xy: 475, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -440,98 +440,98 @@ blocks/iceedge index: -1 blocks/icerock1 rotate: false - xy: 984, 485 + xy: 524, 107 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/icerock2 rotate: false - xy: 994, 485 + xy: 786, 393 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/icerockshadow1 rotate: false - xy: 1004, 485 + xy: 796, 393 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rockshadow1 rotate: false - xy: 1004, 485 + xy: 796, 393 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/icerockshadow2 rotate: false - xy: 1014, 485 + xy: 844, 485 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rockshadow2 rotate: false - xy: 1014, 485 + xy: 844, 485 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/iron1 rotate: false - xy: 861, 465 + xy: 924, 485 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/iron2 rotate: false - xy: 871, 475 + xy: 934, 485 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/iron3 rotate: false - xy: 861, 455 + xy: 944, 485 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/irondrill rotate: false - xy: 871, 465 + xy: 954, 485 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/ironwall rotate: false - xy: 881, 475 + xy: 964, 485 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/junction rotate: false - xy: 871, 455 + xy: 974, 485 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/laserturret rotate: false - xy: 351, 89 + xy: 243, 85 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/lava rotate: false - xy: 881, 465 + xy: 984, 485 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -545,63 +545,63 @@ blocks/lavaedge index: -1 blocks/lavasmelter rotate: false - xy: 891, 475 + xy: 994, 485 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/liquiditemjunction rotate: false - xy: 881, 455 + xy: 1004, 485 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/liquidjunction rotate: false - xy: 891, 465 + xy: 1014, 485 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/liquidrouter rotate: false - xy: 901, 475 + xy: 841, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/machineturret rotate: false - xy: 363, 93 + xy: 243, 73 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/megarepairturret rotate: false - xy: 375, 93 + xy: 255, 85 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/mortarturret rotate: false - xy: 387, 93 + xy: 255, 73 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/mossblock rotate: false - xy: 901, 465 + xy: 851, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/mossstone rotate: false - xy: 901, 465 + xy: 851, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -622,7 +622,7 @@ blocks/nuclearreactor-center index: -1 blocks/nuclearreactor-icon rotate: false - xy: 901, 455 + xy: 851, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -643,7 +643,7 @@ blocks/nuclearreactor-small index: -1 blocks/oil rotate: false - xy: 911, 465 + xy: 861, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -657,182 +657,182 @@ blocks/oiledge index: -1 blocks/oilrefinery rotate: false - xy: 921, 475 + xy: 851, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/omnidrill rotate: false - xy: 911, 455 + xy: 861, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/plasmaturret rotate: false - xy: 399, 93 + xy: 267, 85 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/playerspawn rotate: false - xy: 921, 465 + xy: 871, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/powerbooster rotate: false - xy: 931, 475 + xy: 861, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/poweredconveyor rotate: false - xy: 921, 455 + xy: 871, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/poweredconveyormove rotate: false - xy: 931, 465 + xy: 881, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/powerlaser rotate: false - xy: 941, 475 + xy: 871, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/powerlasercorner rotate: false - xy: 931, 455 + xy: 881, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/powerlaserrouter rotate: false - xy: 941, 465 + xy: 891, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/pulseconduit rotate: false - xy: 951, 475 + xy: 881, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/pulseconduitbottom rotate: false - xy: 941, 455 + xy: 891, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/pulseconduittop rotate: false - xy: 951, 465 + xy: 901, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/pump rotate: false - xy: 961, 475 + xy: 891, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/repairturret rotate: false - xy: 411, 93 + xy: 267, 73 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/rock1 rotate: false - xy: 961, 465 + xy: 911, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rock2 rotate: false - xy: 971, 475 + xy: 901, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/router rotate: false - xy: 961, 455 + xy: 911, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rtgenerator rotate: false - xy: 971, 465 + xy: 921, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rtgenerator-top rotate: false - xy: 981, 475 + xy: 911, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sand1 rotate: false - xy: 971, 455 + xy: 921, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sand2 rotate: false - xy: 981, 465 + xy: 931, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sand3 rotate: false - xy: 991, 475 + xy: 921, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sandblock1 rotate: false - xy: 981, 455 + xy: 931, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sandblock2 rotate: false - xy: 991, 465 + xy: 941, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sandblock3 rotate: false - xy: 1001, 475 + xy: 931, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -846,126 +846,126 @@ blocks/sandedge index: -1 blocks/shadow rotate: false - xy: 423, 93 + xy: 279, 85 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/shieldgenerator rotate: false - xy: 1001, 465 + xy: 951, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/shotgunturret rotate: false - xy: 435, 93 + xy: 279, 73 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/shrub rotate: false - xy: 1011, 465 + xy: 961, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/shrubshadow rotate: false - xy: 1011, 455 + xy: 951, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/smelter rotate: false - xy: 315, 69 + xy: 961, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sniperturret rotate: false - xy: 447, 93 + xy: 291, 85 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/snow1 rotate: false - xy: 325, 69 + xy: 971, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snow2 rotate: false - xy: 335, 69 + xy: 961, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snow3 rotate: false - xy: 345, 69 + xy: 971, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snowblock1 rotate: false - xy: 355, 69 + xy: 981, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snowblock2 rotate: false - xy: 365, 73 + xy: 971, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snowblock3 rotate: false - xy: 375, 73 + xy: 981, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snowedge rotate: false - xy: 95, 33 + xy: 95, 19 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 blocks/sorter rotate: false - xy: 385, 73 + xy: 991, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/steelconveyor rotate: false - xy: 395, 73 + xy: 981, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/steelconveyormove rotate: false - xy: 405, 73 + xy: 991, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/steelwall rotate: false - xy: 415, 73 + xy: 1001, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -979,42 +979,42 @@ blocks/steelwall-large index: -1 blocks/steelwall-large-icon rotate: false - xy: 425, 73 + xy: 991, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stone1 rotate: false - xy: 435, 73 + xy: 1001, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stone2 rotate: false - xy: 445, 73 + xy: 1011, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stone3 rotate: false - xy: 455, 73 + xy: 1001, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock1 rotate: false - xy: 465, 73 + xy: 1011, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock2 rotate: false - xy: 475, 73 + xy: 1011, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1035,7 +1035,7 @@ blocks/stonedrill index: -1 blocks/stoneedge rotate: false - xy: 95, 19 + xy: 109, 77 size: 12, 12 orig: 12, 12 offset: 0, 0 @@ -1084,7 +1084,7 @@ blocks/titancannon index: -1 blocks/titancannon-icon rotate: false - xy: 459, 93 + xy: 291, 73 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -1154,7 +1154,7 @@ blocks/titaniumwall-large-icon index: -1 blocks/turret rotate: false - xy: 471, 93 + xy: 303, 89 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -1196,28 +1196,28 @@ blocks/water index: -1 blocks/wateredge rotate: false - xy: 109, 77 + xy: 109, 63 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 blocks/waveturret rotate: false - xy: 183, 73 + xy: 303, 77 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 bullet rotate: false - xy: 285, 75 + xy: 355, 81 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 chainbullet rotate: false - xy: 527, 117 + xy: 183, 64 size: 8, 7 orig: 8, 7 offset: 0, 0 @@ -1476,56 +1476,56 @@ enemies/titanenemy-t3 index: -1 enemyarrow rotate: false - xy: 305, 70 + xy: 527, 117 size: 8, 7 orig: 8, 7 offset: 0, 0 index: -1 icon-coal rotate: false - xy: 841, 475 + xy: 854, 485 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-dirium rotate: false - xy: 841, 465 + xy: 864, 485 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-iron rotate: false - xy: 851, 475 + xy: 874, 485 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-steel rotate: false - xy: 841, 455 + xy: 884, 485 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-stone rotate: false - xy: 851, 465 + xy: 894, 485 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-titanium rotate: false - xy: 861, 475 + xy: 904, 485 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-uranium rotate: false - xy: 851, 455 + xy: 914, 485 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1558,23 +1558,30 @@ mechs/mech-standard orig: 12, 12 offset: 0, 0 index: -1 +mechs/ship-standard + rotate: false + xy: 95, 33 + size: 12, 12 + orig: 12, 12 + offset: 0, 0 + index: -1 shell rotate: false - xy: 991, 455 + xy: 941, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shot rotate: false - xy: 1011, 475 + xy: 941, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shot-long rotate: false - xy: 1001, 455 + xy: 951, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1680,7 +1687,7 @@ ui/check-over index: -1 ui/clear rotate: false - xy: 123, 79 + xy: 109, 51 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -1708,7 +1715,7 @@ ui/icons/icon-add index: -1 ui/icons/icon-areaDelete rotate: false - xy: 109, 41 + xy: 109, 39 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -1722,28 +1729,28 @@ ui/icons/icon-arrow index: -1 ui/icons/icon-arrow-down rotate: false - xy: 147, 79 + xy: 135, 67 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/icons/icon-arrow-left rotate: false - xy: 109, 29 + xy: 147, 79 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/icons/icon-arrow-right rotate: false - xy: 159, 79 + xy: 109, 27 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/icons/icon-arrow-up rotate: false - xy: 95, 7 + xy: 147, 67 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -1792,21 +1799,21 @@ ui/icons/icon-close-over index: -1 ui/icons/icon-crafting rotate: false - xy: 109, 17 + xy: 159, 79 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/icons/icon-cursor rotate: false - xy: 107, 5 + xy: 159, 67 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/icons/icon-defense rotate: false - xy: 171, 79 + xy: 95, 7 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -1820,7 +1827,7 @@ ui/icons/icon-discord index: -1 ui/icons/icon-distribution rotate: false - xy: 183, 85 + xy: 109, 15 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -1890,14 +1897,14 @@ ui/icons/icon-grid index: -1 ui/icons/icon-hold rotate: false - xy: 195, 85 + xy: 171, 79 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/icons/icon-holdDelete rotate: false - xy: 207, 85 + xy: 171, 67 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -1911,7 +1918,7 @@ ui/icons/icon-home index: -1 ui/icons/icon-info rotate: false - xy: 219, 85 + xy: 107, 3 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -1953,21 +1960,21 @@ ui/icons/icon-loading index: -1 ui/icons/icon-menu rotate: false - xy: 231, 85 + xy: 183, 85 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/icons/icon-none rotate: false - xy: 243, 85 + xy: 183, 73 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/icons/icon-pause rotate: false - xy: 255, 85 + xy: 195, 85 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -1988,7 +1995,7 @@ ui/icons/icon-pick index: -1 ui/icons/icon-play rotate: false - xy: 267, 85 + xy: 195, 73 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -2002,14 +2009,14 @@ ui/icons/icon-play-2 index: -1 ui/icons/icon-power rotate: false - xy: 279, 85 + xy: 207, 85 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/icons/icon-production rotate: false - xy: 291, 85 + xy: 207, 73 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -2093,7 +2100,7 @@ ui/icons/icon-save-map index: -1 ui/icons/icon-settings rotate: false - xy: 303, 89 + xy: 219, 85 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -2114,14 +2121,14 @@ ui/icons/icon-tools index: -1 ui/icons/icon-touch rotate: false - xy: 315, 89 + xy: 219, 73 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/icons/icon-touchDelete rotate: false - xy: 327, 89 + xy: 231, 85 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -2149,7 +2156,7 @@ ui/icons/icon-undo index: -1 ui/icons/icon-weapon rotate: false - xy: 339, 89 + xy: 231, 73 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -2329,35 +2336,35 @@ ui/window-empty index: -1 weapons/blaster rotate: false - xy: 265, 75 + xy: 345, 81 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/flamer rotate: false - xy: 884, 485 + xy: 435, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/mortar rotate: false - xy: 891, 455 + xy: 841, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/multigun rotate: false - xy: 911, 475 + xy: 841, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/railgun rotate: false - xy: 951, 455 + xy: 901, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index 0847a11908..62f0be40b9 100644 Binary files a/core/assets/sprites/sprites.png and b/core/assets/sprites/sprites.png differ diff --git a/core/src/io/anuke/mindustry/core/Control.java b/core/src/io/anuke/mindustry/core/Control.java index 1f935e08e3..8e7bce2f43 100644 --- a/core/src/io/anuke/mindustry/core/Control.java +++ b/core/src/io/anuke/mindustry/core/Control.java @@ -221,9 +221,8 @@ public class Control extends Module{ wavetime = waveSpacing(); Entities.clear(); enemies = 0; - - if(!android) - player.add(); + + player.add(); player.heal(); clearItems(); diff --git a/core/src/io/anuke/mindustry/core/NetClient.java b/core/src/io/anuke/mindustry/core/NetClient.java index f3c9511571..823919d9c6 100644 --- a/core/src/io/anuke/mindustry/core/NetClient.java +++ b/core/src/io/anuke/mindustry/core/NetClient.java @@ -100,8 +100,12 @@ public class NetClient extends Module { entity = Vars.control.playerGroup.getByID(id); } + Syncable sync = ((Syncable)entity); + + if(sync == null) continue; + //augh - ((Interpolator)((Syncable)entity).getInterpolator()).type.read(entity, packet.data[i]); + ((Interpolator)sync.getInterpolator()).type.read(entity, packet.data[i]); } } }); @@ -151,8 +155,10 @@ public class NetClient extends Module { }); Net.handle(EnemyDeathPacket.class, spawn -> { - Enemy enemy = Vars.control.enemyGroup.getByID(spawn.id); - if(enemy != null) enemy.onDeath(); + Gdx.app.postRunnable(() -> { + Enemy enemy = Vars.control.enemyGroup.getByID(spawn.id); + if (enemy != null) enemy.onDeath(); + }); }); Net.handle(PathPacket.class, packet -> { @@ -170,6 +176,24 @@ public class NetClient extends Module { Entity owner = Vars.control.enemyGroup.getByID(packet.owner); Bullet bullet = new Bullet(type, owner, packet.x, packet.y, packet.angle).add(); }); + + Net.handle(BlockDestroyPacket.class, packet -> { + Tile tile = Vars.world.tile(packet.position % Vars.world.width(), packet.position / Vars.world.width()); + if(tile.entity != null){ + tile.entity.onDeath(true); + } + }); + + Net.handle(BlockUpdatePacket.class, packet -> { + Tile tile = Vars.world.tile(packet.position % Vars.world.width(), packet.position / Vars.world.width()); + if(tile.entity != null){ + tile.entity.health = packet.health; + } + }); + + Net.handle(BlockSyncPacket.class, packet -> { + //TODO implementation, load data... + }); } public void update(){ diff --git a/core/src/io/anuke/mindustry/core/NetServer.java b/core/src/io/anuke/mindustry/core/NetServer.java index 6b1b87e349..f1dac847e4 100644 --- a/core/src/io/anuke/mindustry/core/NetServer.java +++ b/core/src/io/anuke/mindustry/core/NetServer.java @@ -2,11 +2,13 @@ package io.anuke.mindustry.core; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.utils.IntArray; import com.badlogic.gdx.utils.IntMap; import io.anuke.mindustry.Vars; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.entities.BulletType; import io.anuke.mindustry.entities.Player; +import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.enemies.Enemy; import io.anuke.mindustry.io.NetworkIO; import io.anuke.mindustry.net.Net; @@ -22,10 +24,12 @@ import io.anuke.ucore.core.Effects.Effect; import io.anuke.ucore.core.Timers; import io.anuke.ucore.entities.Entity; import io.anuke.ucore.modules.Module; +import io.anuke.ucore.util.Mathf; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; +import java.io.IOException; import java.util.Arrays; public class NetServer extends Module{ @@ -66,7 +70,6 @@ public class NetServer extends Module{ UCore.log("Sending entities: " + Arrays.toString(dp.players)); //TODO send pathfind positions - //TODO new denser format //TODO save enemy nodes Net.sendTo(packet.id, dp, SendMode.tcp); @@ -166,6 +169,19 @@ public class NetServer extends Module{ Net.send(packet, SendMode.tcp); } + public void handleBlockDestroyed(TileEntity entity){ + BlockDestroyPacket packet = new BlockDestroyPacket(); + packet.position = entity.tile.packedPosition(); + Net.send(packet, SendMode.tcp); + } + + public void handleBlockDamaged(TileEntity entity){ + BlockUpdatePacket packet = new BlockUpdatePacket(); + packet.health = entity.health; + packet.position = entity.tile.packedPosition(); + Net.send(packet, SendMode.udp); + } + public void update(){ if(!Net.server()) return; @@ -220,18 +236,59 @@ public class NetServer extends Module{ if(Timers.get("serverBlockSync", blockSyncTime)){ BlockSyncPacket packet = new BlockSyncPacket(); - //TODO + IntArray connections = Net.getConnections(); + + for(int i = 0; i < connections.size; i ++){ + int id = connections.get(i); + Player player = this.connections.get(i); + int x = Mathf.scl2(player.x, Vars.tilesize); + int y = Mathf.scl2(player.y, Vars.tilesize); + } + + //TODO sync to each player entity } } - public void sendBlockSync(int client){ + public void sendBlockSync(int client, int x, int y, int viewx, int viewy){ BlockSyncPacket packet = new BlockSyncPacket(); - ByteArrayOutputStream bs = new ByteArrayOutputStream(); - DataOutputStream stream = new DataOutputStream(bs); - //TODO + try { + DataOutputStream stream = new DataOutputStream(bs); + + for (int rx = -viewx / 2; rx <= viewx / 2; rx++) { + for (int ry = -viewy / 2; ry <= viewy / 2; ry++) { + Tile tile = Vars.world.tile(x + rx, y + ry); + + if (tile == null || tile.entity == null) continue; + + stream.writeInt(tile.packedPosition()); + byte times = 0; + + for(; times < tile.entity.timer.getTimes().length; times ++){ + if(tile.entity.timer.getTimes()[times] > 0){ + break; + } + } + + stream.writeByte(times); + + for(int i = 0; i < times; i ++){ + stream.writeFloat(tile.entity.timer.getTimes()[times]); + } + + tile.entity.write(stream); + } + } + + }catch (IOException e){ + throw new RuntimeException(e); + } + + //TODO finish packet.stream = new ByteArrayInputStream(bs.toByteArray()); + + Net.sendStream(client, packet); } } diff --git a/core/src/io/anuke/mindustry/entities/Player.java b/core/src/io/anuke/mindustry/entities/Player.java index 8851e703e0..b4cba08ad4 100644 --- a/core/src/io/anuke/mindustry/entities/Player.java +++ b/core/src/io/anuke/mindustry/entities/Player.java @@ -79,20 +79,22 @@ public class Player extends DestructibleEntity implements Syncable{ @Override public void draw(){ - if(Vars.debug && (!Vars.showPlayer || !Vars.showUI)) return; + if((Vars.debug && (!Vars.showPlayer || !Vars.showUI)) || (Vars.android && isLocal)) return; + + String part = Vars.android ? "ship" : "mech"; if(Vars.snapCamera && Settings.getBool("smoothcam") && Settings.getBool("pixelate")){ - Draw.rect("mech-"+mech.name(), (int)x, (int)y, angle-90); + Draw.rect(part+"-"+mech.name(), (int)x, (int)y, angle-90); }else{ - Draw.rect("mech-"+mech.name(), x, y, angle-90); + Draw.rect(part+"-"+mech.name(), x, y, angle-90); } } @Override public void update(){ - if(!isLocal){ - if(!isDead()) inter.update(this); + if(!isLocal || android){ + if(!isDead() && !isLocal) inter.update(this); return; } diff --git a/core/src/io/anuke/mindustry/entities/TileEntity.java b/core/src/io/anuke/mindustry/entities/TileEntity.java index 071134313a..21ea1d52b1 100644 --- a/core/src/io/anuke/mindustry/entities/TileEntity.java +++ b/core/src/io/anuke/mindustry/entities/TileEntity.java @@ -1,12 +1,9 @@ package io.anuke.mindustry.entities; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - import io.anuke.mindustry.Vars; import io.anuke.mindustry.entities.enemies.Enemy; import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.net.Net; import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; @@ -18,6 +15,10 @@ import io.anuke.ucore.entities.Entity; import io.anuke.ucore.util.Mathf; import io.anuke.ucore.util.Timer; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; + public class TileEntity extends Entity{ public Tile tile; public int[] items = new int[Item.getAllItems().size]; @@ -54,19 +55,28 @@ public class TileEntity extends Entity{ } public void onDeath(){ - - if(tile.block() == ProductionBlocks.core){ - Vars.control.coreDestroyed(); + onDeath(false); + } + + public void onDeath(boolean force){ + if(Net.active() && Net.server()){ + Vars.netServer.handleBlockDestroyed(this); } - if(!dead) { - dead = true; - Block block = tile.block(); + if(!Net.active() || Net.server() || force){ + if(tile.block() == ProductionBlocks.core){ + Vars.control.coreDestroyed(); + } - block.onDestroyed(tile); + if(!dead) { + dead = true; + Block block = tile.block(); - Vars.world.removeBlock(tile); - remove(); + block.onDestroyed(tile); + + Vars.world.removeBlock(tile); + remove(); + } } } @@ -80,6 +90,10 @@ public class TileEntity extends Entity{ int amount = tile.block().handleDamage(tile, damage); health -= amount; if(health <= 0) onDeath(); + + if(Net.active() && Net.server()){ + Vars.netServer.handleBlockDamaged(this); + } } public boolean collide(Bullet other){ diff --git a/core/src/io/anuke/mindustry/input/GestureHandler.java b/core/src/io/anuke/mindustry/input/GestureHandler.java index 57eea040fb..94bc361802 100644 --- a/core/src/io/anuke/mindustry/input/GestureHandler.java +++ b/core/src/io/anuke/mindustry/input/GestureHandler.java @@ -1,15 +1,15 @@ package io.anuke.mindustry.input; -import static io.anuke.mindustry.Vars.*; - import com.badlogic.gdx.Gdx; import com.badlogic.gdx.input.GestureDetector.GestureAdapter; import com.badlogic.gdx.math.Vector2; - import io.anuke.mindustry.Vars; import io.anuke.ucore.core.Core; import io.anuke.ucore.core.Inputs; import io.anuke.ucore.scene.ui.layout.Unit; +import io.anuke.ucore.util.Mathf; + +import static io.anuke.mindustry.Vars.*; public class GestureHandler extends GestureAdapter{ AndroidInput input; @@ -49,8 +49,10 @@ public class GestureHandler extends GestureAdapter{ if(!Vars.control.showCursor() && !(player.recipe != null && Vars.control.hasItems(player.recipe.requirements) && player.placeMode.lockCamera) && !(player.recipe == null && player.breakMode.lockCamera)){ - player.x -= deltaX*Core.camera.zoom/Core.cameraScale; - player.y += deltaY*Core.camera.zoom/Core.cameraScale; + float dx = deltaX*Core.camera.zoom/Core.cameraScale, dy = deltaY*Core.camera.zoom/Core.cameraScale; + player.x -= dx; + player.y += dy; + player.angle = Mathf.lerpAngDelta(player.angle, Mathf.atan2(dx, dy), 0.5f); }else if(player.placeMode.lockCamera && (player.placeMode.pan && player.recipe != null)){ input.mousex += deltaX; input.mousey += deltaY; diff --git a/core/src/io/anuke/mindustry/net/Net.java b/core/src/io/anuke/mindustry/net/Net.java index af0d55c8c2..7c79dfe6cd 100644 --- a/core/src/io/anuke/mindustry/net/Net.java +++ b/core/src/io/anuke/mindustry/net/Net.java @@ -1,6 +1,7 @@ package io.anuke.mindustry.net; import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.utils.IntArray; import com.badlogic.gdx.utils.IntMap; import com.badlogic.gdx.utils.ObjectMap; import io.anuke.mindustry.net.Streamable.StreamBegin; @@ -48,6 +49,11 @@ public class Net{ server = false; active = false; } + + /**Returns a list of all connections IDs.*/ + public static IntArray getConnections(){ + return serverProvider.getConnections(); + } /**Send an object to all connected clients, or to the server if this is a client.*/ public static void send(Object object, SendMode mode){ @@ -182,6 +188,8 @@ public class Net{ public void sendExcept(int id, Object object, SendMode mode); /**Close the server connection.*/ public void close(); + /**Return all connected users.*/ + public IntArray getConnections(); /**Register classes to be sent.*/ public void register(Class... types); } diff --git a/core/src/io/anuke/mindustry/net/Packets.java b/core/src/io/anuke/mindustry/net/Packets.java index c0c9305976..13fc79d516 100644 --- a/core/src/io/anuke/mindustry/net/Packets.java +++ b/core/src/io/anuke/mindustry/net/Packets.java @@ -96,6 +96,6 @@ public class Packets { } public static class BlockUpdatePacket{ - public int health; + public int health, position; } } diff --git a/core/src/io/anuke/mindustry/net/Registrator.java b/core/src/io/anuke/mindustry/net/Registrator.java index 96cc6219d2..a9f733317c 100644 --- a/core/src/io/anuke/mindustry/net/Registrator.java +++ b/core/src/io/anuke/mindustry/net/Registrator.java @@ -29,6 +29,8 @@ public class Registrator { PathPacket.class, BulletPacket.class, EnemyDeathPacket.class, + BlockUpdatePacket.class, + BlockDestroyPacket.class, Class.class, byte[].class, diff --git a/core/src/io/anuke/mindustry/net/Syncable.java b/core/src/io/anuke/mindustry/net/Syncable.java index 225c78d46d..6e31f342c3 100644 --- a/core/src/io/anuke/mindustry/net/Syncable.java +++ b/core/src/io/anuke/mindustry/net/Syncable.java @@ -1,9 +1,14 @@ package io.anuke.mindustry.net; import com.badlogic.gdx.math.Vector2; +import io.anuke.mindustry.Vars; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.enemies.Enemy; +import io.anuke.mindustry.graphics.Fx; +import io.anuke.ucore.core.Effects; +import io.anuke.ucore.core.Timers; import io.anuke.ucore.entities.Entity; +import io.anuke.ucore.util.Angles; import io.anuke.ucore.util.Mathf; //TODO clean up this giant mess @@ -36,6 +41,11 @@ public interface Syncable { entity.set(i.target.x, i.target.y); } + if(Vars.android && i.target.dst(entity.x, entity.y) > 2f && Timers.get(entity, "dashfx", 3)){ + Angles.translation(entity.angle + 180, 3f); + Effects.effect(Fx.dashsmoke, entity.x + Angles.x(), entity.y + Angles.y()); + } + entity.x = Mathf.lerpDelta(entity.x, i.target.x, 0.4f); entity.y = Mathf.lerpDelta(entity.y, i.target.y, 0.4f); entity.angle = Mathf.lerpAngDelta(entity.angle, i.targetrot, 0.6f); diff --git a/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java b/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java index a4e9551ae6..fc0ab1c8cb 100644 --- a/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java +++ b/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java @@ -1,8 +1,10 @@ package io.anuke.mindustry.desktop; +import com.badlogic.gdx.Gdx; import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application; import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration; import com.badlogic.gdx.utils.Array; +import com.badlogic.gdx.utils.IntArray; import com.esotericsoftware.kryonet.*; import com.esotericsoftware.kryonet.util.InputStreamSender; import com.esotericsoftware.minlog.Log; @@ -98,7 +100,14 @@ public class DesktopLauncher { @Override public void received (Connection connection, Object object) { if(object instanceof FrameworkMessage) return; - Net.handleClientReceived(object); + + try{ + Net.handleClientReceived(object); + }catch (Exception e){ + Gdx.app.exit(); + throw new RuntimeException(e); + } + } }); @@ -144,6 +153,7 @@ public class DesktopLauncher { Net.setServerProvider(new ServerProvider() { Server server; + IntArray connections = new IntArray(); { server = new Server(); @@ -157,6 +167,7 @@ public class DesktopLauncher { c.id = connection.getID(); c.addressTCP = connection.getRemoteAddressTCP().toString(); Net.handleServerReceived(c, c.id); + connections.add(c.id); } @Override @@ -164,18 +175,30 @@ public class DesktopLauncher { Disconnect c = new Disconnect(); c.id = connection.getID(); Net.handleServerReceived(c, c.id); + connections.removeValue(c.id); } @Override public void received (Connection connection, Object object) { if(object instanceof FrameworkMessage) return; - Net.handleServerReceived(object, connection.getID()); + + try{ + Net.handleServerReceived(object, connection.getID()); + }catch (Exception e){ + Gdx.app.exit(); + throw new RuntimeException(e); + } } }); register(Registrator.getClasses()); } + @Override + public IntArray getConnections() { + return connections; + } + @Override public void host(int port) throws IOException { server.bind(port, port);