From c10edf9c33335af4b96b95fa08d38bb182b490db Mon Sep 17 00:00:00 2001 From: Alex Ilchenko Date: Wed, 27 Mar 2024 11:46:37 +0100 Subject: [PATCH] fix(engine): fixed passing velocity, levels update --- public/levels/000011LRee.json | 30 +++++------ public/levels/0000Dmmoww.json | 26 ++++----- public/levels/000DUmmooqw.json | 46 ++++++++-------- public/levels/0012Ummoor.json | 54 +++++++++---------- .../get-next-board-state.ts | 8 ++- 5 files changed, 81 insertions(+), 83 deletions(-) diff --git a/public/levels/000011LRee.json b/public/levels/000011LRee.json index f395867..3cfff05 100644 --- a/public/levels/000011LRee.json +++ b/public/levels/000011LRee.json @@ -1,26 +1,26 @@ [ - "3:23:100-1eL-xx0-0Re:Used Release", - "4:40:e0L-0Re-x10-x01:Skinny Soup", "5:40:eL1-x0e-x00-xx0-xR1:Spiky Pizza", + "5:51:e0L-ex0-1R0-1xx-0xx:Used Understanding", + "5:51:0xx-R1e-01e-0L0:Stupendous Appearance", + "5:59:e0L-0Re-x10-x01:Skinny Soup", "5:86:e0e-0x1-1xx-0Lx-R0x:Flaky Visual", - "5:96:0xx-eR0-x00-xeL-x11:Chubby Shirt", - "5:128:xxx0-1L0e-R01x-x0ex:Tight Benefit", - "5:129:R000-1L10-eexx:Scrawny Other", - "6:94:e0L-ex0-1R0-1xx-0xx:Used Understanding", + "5:95:0xx-eR0-x00-xeL-x11:Chubby Shirt", + "5:121:R000-1L10-eexx:Scrawny Other", + "5:127:xx0x-e01L-x0R0-xxe1:Tall Pressure", + "5:141:xxx0-1L0e-R01x-x0ex:Tight Benefit", "6:102:1L0-0x0-eRe-x0x-x1x:Ill Ruin", - "6:130:0xx-R1e-01e-0L0:Stupendous Appearance", + "6:123:Re0-e00-11L-xx0:Useful Shake", "6:138:1R0x-xx01-xeL0-x0ex:Rough Young", "6:148:1Lxx-00xx-xeR0-xxe1-xx0x:Loutish Cloud", "6:173:ee0-1L0-xR0-x01:Versed Player", - "6:181:Re0-e00-11L-xx0:Useful Shake", "6:199:010-xR0-xeL-xx0-xe1:Cynical Relation", - "6:209:xx0x-e01L-x0R0-xxe1:Tall Pressure", + "7:96:100-1eL-xx0-0Re:Used Release", "7:99:0Lx-01x-0e1-0Re:Fumbling Person", + "7:109:xxe0-Re10-0x1L-xx0x:Lopsided Procedure", "7:135:011e-eLR0-00xx:Petite Manner", - "7:214:xe1-R00-eL0-10x:Uninterested Progress", - "7:284:x0x-x00-R10-eLx-1ex:Afraid Guess", - "9:678:xe0x-x1L1-eR00-0xxx:Amuck Closet", - "9:1022:x10x-10Le-00Re:Fresh Mortgage", - "15:1226:xe0-xRe-0L1-001:Adhesive Cold", - "17:381:xxe0-Re10-0x1L-xx0x:Lopsided Procedure" + "7:188:xe1-R00-eL0-10x:Uninterested Progress", + "8:353:x0x-x00-R10-eLx-1ex:Afraid Guess", + "11:878:x10x-10Le-00Re:Fresh Mortgage", + "11:1040:xe0x-x1L1-eR00-0xxx:Amuck Closet", + "15:1226:xe0-xRe-0L1-001:Adhesive Cold" ] \ No newline at end of file diff --git a/public/levels/0000Dmmoww.json b/public/levels/0000Dmmoww.json index 6b254bd..24effff 100644 --- a/public/levels/0000Dmmoww.json +++ b/public/levels/0000Dmmoww.json @@ -1,34 +1,34 @@ [ - "3:13:xw0-D0o-wmm-00x:Null Medicine", "5:57:xxDm-xw0w-00xx-0mxx-xoxx:Craven Access", "5:59:w0x-mox-D0m-0w0:Snotty Clue", "5:63:wmm-wD0-00x-oxx-0xx:Cuddly Expert", - "5:69:xox-xm0-D0m-w0x-0wx:Actually Meeting", - "5:77:0wx-D0x-0mo-m0w:Observant Sector", - "6:38:m00x-xxmx-xx0D-xxxw-xow0:Earsplitting Fan", + "5:66:xox-xm0-D0m-w0x-0wx:Actually Meeting", + "6:33:m00x-xxmx-xx0D-xxxw-xow0:Earsplitting Fan", + "6:57:xw0-D0o-wmm-00x:Null Medicine", + "6:69:0wx-D0x-0mo-m0w:Observant Sector", "6:77:0wx-Dwm-00m-x0o:Shaky Script", - "6:80:x0x-x00-xDw-xmm-0ow:Many Term", + "6:84:x0x-x00-xDw-xmm-0ow:Many Term", "6:119:xxx0-o0xD-mw0w-m0xx:Spotty Error", - "6:190:x0xx-0Dxw-wm0o-x0mx:Windy Object", - "7:76:xxm-mDo-00x-w0x-0wx:Ossified Wonder", - "7:106:x0x-x0o-xxD-0ww-mm0:Physical Middle", + "7:151:xwD-mmo-xw0-x0x-00x:Peaceful Internal", "7:157:xx0-xwo-wmx-D00-m0x:Plastic Surround", + "7:158:xx0x-wx0D-m00m-xxow:Raspy Many", + "8:29:xxm-mDo-00x-w0x-0wx:Ossified Wonder", "8:81:Dxxx-m0xx-xm0o-xx00-xxww:Noiseless Breakfast", "8:212:xw0-0mD-0wo-0xx-mxx:Jagged Purpose", + "8:241:x0xx-0Dxw-wm0o-x0mx:Windy Object", "8:245:wxx-mxx-wxx-000-Dox-0mx:Cautious South", "9:147:0o0-mDx-w0x-0xx-mwx:Simplistic Summer", "9:196:00x-mo0-0xm-wxx-Dxx-wxx:Harsh Spring", "9:239:xx0x-00wx-0wmm-xxxD-xxxo:Last Tower", "9:405:x00x-0wxx-0mDo-xxmw:Nonstop Level", - "10:196:0Dx-w0w-0mo-0xx-mxx:Cluttered Yellow", - "10:397:xwD-mmo-xw0-x0x-00x:Peaceful Internal", - "10:397:xx0x-wx0D-m00m-xxow:Raspy Many", + "10:113:0Dx-w0w-0mo-0xx-mxx:Cluttered Yellow", "12:208:ww0-omm-x0D-x00:Attractive Practice", "12:399:o0m0-wmxx-xwDx-x00x:Determined Partner", "12:479:xxmxx-xx0wD-xom0w-00xxx:Responsible Woman", "12:511:D0mx-0o0x-xxwx-xxmw-xxx0:Didactic Family", - "13:709:wmD-wxo-000-0xx-mxx:Curvy Bunch", - "15:168:xDxx-xmw0-m00o-xx0w:Hulking Advertising", + "12:559:wmD-wxo-000-0xx-mxx:Curvy Bunch", + "16:154:xDxx-xmw0-m00o-xx0w:Hulking Advertising", "16:670:xDx-0ox-mxx-w00-w0m:Acid Cry", + "17:207:x0x-x0o-xxD-0ww-mm0:Physical Middle", "25:1013:owx-Dw0-000-xxm-xxm:Sturdy Bonus" ] \ No newline at end of file diff --git a/public/levels/000DUmmooqw.json b/public/levels/000DUmmooqw.json index df4cc5a..b6e4207 100644 --- a/public/levels/000DUmmooqw.json +++ b/public/levels/000DUmmooqw.json @@ -1,32 +1,32 @@ [ - "4:53:xowm-oq0D-0mU0:Like Sport", - "4:89:000-Dwo-qUx-omx-xmx:Loud Screw", - "5:68:0ox-mox-qm0-DUx-w0x:Rabid Setting", - "6:50:000m-xUqw-mDxx-ooxx:Nappy Potato", + "6:20:xxowo-xxxxm-xxxx0-xDm0U-0qxxx:Accurate Time", + "6:24:Dmx-wmx-00x-o0o-qxU:Fearless Bathroom", + "6:51:0mo-w0U-xDx-xox-x0q-xxm:Diligent Championship", + "6:59:0wxx-Doxx-mUxx-xq00-xxom:Stimulating Exercise", "6:66:oqwm-x0mU-xxoD-xx00:Skinny Day", - "6:80:qm0wo-oDU0x-0mxxx:Unusual Tie", - "6:84:0mo-w0U-xDx-xox-x0q-xxm:Diligent Championship", + "6:70:000m-xUqw-mDxx-ooxx:Nappy Potato", + "6:80:xoDq-0mwo-0xxx-Uxxx-0mxx:Wholesale Truck", "6:84:D00-wU0-xmx-qmx-oox:Ripe Difference", "6:101:xxxm-m0oU-Dxqw-o00x:Open Country", - "6:113:xoDq-0mwo-0xxx-Uxxx-0mxx:Wholesale Truck", - "6:131:qxx-wo0-m0D-xU0-xom:Female Difference", - "7:41:xxowo-xxxxm-xxxx0-xDm0U-0qxxx:Accurate Time", - "7:104:xxD-xq0-xU0-xmo-0ox-wmx:Salty Attempt", - "7:108:0wxx-Doxx-mUxx-xq00-xxom:Stimulating Exercise", + "6:103:qxx-wo0-m0D-xU0-xom:Female Difference", + "6:134:0Do-mom-U00-wqx:Disagreeable Corner", + "6:179:xowm-oq0D-0mU0:Like Sport", + "7:57:m0D-o00-Umq-owx:Minor Excuse", + "7:111:xxD-xq0-xU0-xmo-0ox-wmx:Salty Attempt", "7:173:mwxx-U0ox-qx0D-xxm0-xxox:Clear Lay", - "7:232:oqoD-0Uwm-m00x:Marvelous Assist", - "8:131:Doq0-omw0-xUm0:Squeamish Blow", - "8:141:0Do-mom-U00-wqx:Disagreeable Corner", - "8:209:0qD-0m0-Umx-xox-wox:Easy People", + "8:117:qm0wo-oDU0x-0mxxx:Unusual Tie", + "8:121:Doq0-omw0-xUm0:Squeamish Blow", + "8:177:0qD-0m0-Umx-xox-wox:Easy People", "8:226:xxq-xmo-xUw-oD0-0m0:Sedate Wall", - "8:442:mxx-D00-qo0-mUo-wxx:Savory Grand", - "9:104:m0D-o00-Umq-owx:Minor Excuse", + "8:385:000-Dwo-qUx-omx-xmx:Loud Screw", "9:106:xxmwx-xxxmx-xxxDq-xxo00-o0Uxx:Recondite Term", - "9:206:mxx-Uxx-Dxx-0xx-oxo-mq0-0wx:Absurd Region", - "9:625:0xxx-0Dmq-xoom-x0Uw:Full Weekend", - "11:330:mm0-wxx-0ox-Dqx-0Uo:Acceptable Temperature", - "12:333:xxom-xx0w-D0mx-0qxx-oUxx:Maddening Possible", - "13:121:Dmx-wmx-00x-o0o-qxU:Fearless Bathroom", + "9:118:mxx-Uxx-Dxx-0xx-oxo-mq0-0wx:Absurd Region", + "9:388:0ox-mox-qm0-DUx-w0x:Rabid Setting", + "9:511:oqoD-0Uwm-m00x:Marvelous Assist", + "9:643:0xxx-0Dmq-xoom-x0Uw:Full Weekend", + "11:214:mm0-wxx-0ox-Dqx-0Uo:Acceptable Temperature", + "11:303:xxom-xx0w-D0mx-0qxx-oUxx:Maddening Possible", + "11:477:mxx-D00-qo0-mUo-wxx:Savory Grand", "13:624:xxowo-xxxxm-00Dmq-xx0Ux:Penitent Word", - "18:184:omqD-0xw0-omxx-x0xx-xUxx:Amuck Extent" + "18:162:omqD-0xw0-omxx-x0xx-xUxx:Amuck Extent" ] \ No newline at end of file diff --git a/public/levels/0012Ummoor.json b/public/levels/0012Ummoor.json index f5d72d1..76c1972 100644 --- a/public/levels/0012Ummoor.json +++ b/public/levels/0012Ummoor.json @@ -1,54 +1,54 @@ [ - "4:29:01m-r0m-2ox-Uxx-oxx:Neighborly Hate", - "5:36:ro-o0-mU-02-1m:Pushy Tooth", - "5:49:oo00-mm21-rUxx:Loutish Success", - "5:52:ro00-xx1m-xoUx-x2mx:Detailed Confusion", + "5:35:ro-o0-mU-02-1m:Pushy Tooth", + "5:41:ro00-xx1m-xoUx-x2mx:Detailed Confusion", "5:55:xxm-xr1-oox-U00-m2x:Ragged Kid", + "5:56:oo00-mm21-rUxx:Loutish Success", + "5:63:10m-roo-mU0-xx2:Internal Championship", "5:70:xx0-m0o-U1o-mr2:Gainful Preparation", "5:72:mxx-Uox-xo1-20m-xr0:Medical Speech", "5:74:ro0-oxm-0xx-12x-mUx:Loving Share", - "6:63:0mx-2mx-0o1-oUr:Tidy Yard", - "6:70:xmxx-xmo0-0o12-xxUr:General Great", - "6:72:1rx-2oo-mm0-xxU-xx0:Glamorous Blank", + "6:42:1rx-2oo-mm0-xxU-xx0:Glamorous Blank", + "6:53:m20-xx0-xor-xm1-xUo:Homeless Fight", + "6:54:xmxx-xmo0-0o12-xxUr:General Great", + "6:59:xmxx-rmxo-2Uxo-x100:Ceaseless Signal", "6:72:2xx-o1r-mmU-00o:Ludicrous Flower", - "6:88:1ro-0m0-xoU-xm2:Measly Net", + "6:87:1ro-0m0-xoU-xm2:Measly Net", "6:91:xrm-xUo-xm2-1ox-00x:Industrious House", - "6:93:1mx-r0m-2Uo-0xx-oxx:Evanescent Reception", - "6:98:x02x-mom0-1oUr:Violent Belt", + "6:95:1mx-r0m-2Uo-0xx-oxx:Evanescent Reception", "6:99:xx0m-xrmU-10xx-2oxx-xoxx:Wonderful Steal", - "6:105:10m-roo-mU0-xx2:Internal Championship", - "6:169:00oo-rmUm-12xx:Silent High", - "7:60:omx-02x-mo0-Ur1:Questionable Opening", - "7:74:m20-xx0-xor-xm1-xUo:Homeless Fight", + "6:109:0mx-2mx-0o1-oUr:Tidy Yard", + "6:170:00oo-rmUm-12xx:Silent High", + "7:83:mox-10x-r2o-0xx-mxx-Uxx:Obsequious Guess", + "7:93:omm-x12-xr0-xxU-x0o:Broad Business", "7:95:x1o-moU-mr2-0xx-0xx:Lyrical High", + "7:98:omx-02x-mo0-Ur1:Questionable Opening", + "7:112:01m-r0m-2ox-Uxx-oxx:Neighborly Hate", "7:122:xx1x-m00x-Uroo-xxxm-xxx2:Righteous Employer", - "7:130:xmxx-rmxo-2Uxo-x100:Ceaseless Signal", "7:130:xx0x-rx2o-1m0U-xxmo:Fanatical Feeling", "7:136:xox-oUx-mxx-r01-0m2:Disgusting Editor", "7:136:x0m-2oU-or0-mxx-1xx:Zany Agent", "7:148:xmr-x2x-x0x-0om-U1o:Finicky Fall", "7:163:xxx0-oom1-Ux0x-m2rx:Brainy Elevator", - "7:182:xx0x-xmrx-0oo2-mU1x:Squeamish Truth", "7:183:x0x-xr1-xmU-o0x-om2:Nutritious Set", "7:203:xr0-m0o-Uo2-1mx:Huge Crash", + "7:260:xx0x-xmrx-0oo2-mU1x:Squeamish Truth", "8:99:x0x-xoo-10U-2mx-mrx:Entertaining Presentation", "8:113:1r0-0Um-xom-2ox:Alleged Single", - "8:178:xmo-xm2-o0r-1xx-U0x:Upbeat Local", - "9:141:omm-x12-xr0-xxU-x0o:Broad Business", - "9:173:xm0-xom-21o-0Ur:Responsible Storm", - "9:189:mox-10x-r2o-0xx-mxx-Uxx:Obsequious Guess", - "9:244:o0o-2mx-r0x-Uxx-1mx:Judicious Shopping", - "9:262:o21-mrm-x0U-xox-x0x:Ugly Addition", + "8:145:xmo-xm2-o0r-1xx-U0x:Upbeat Local", + "8:245:x02x-mom0-1oUr:Violent Belt", + "9:206:o0o-2mx-r0x-Uxx-1mx:Judicious Shopping", + "9:292:xm0-xom-21o-0Ur:Responsible Storm", "9:313:xmxx-m0xr-U2o0-x1ox:Milky Appointment", + "10:79:xro-xm2-10o-0mU:Bouncy Carpet", "10:228:xxoxx-xxU0m-x0omr-12xxx:Cagey Increase", - "10:450:02mo-rmxx-x01x-xUox:Robust Gold", - "10:546:xrm-omo-x0U-x2x-01x:Draconian While", "11:329:xxx0-o0xm-U12r-omxx:Grateful Basis", - "12:61:xro-xm2-10o-0mU:Bouncy Carpet", + "11:629:xrm-omo-x0U-x2x-01x:Draconian While", "12:233:x02x-mr0m-Uo1o:Old Split", "12:277:0m0x-2omx-xx1x-xxor-xxxU:Tasteful View", "12:426:oxxx-U0xx-x2o0-xx1m-xxrm:Graceful Toe", + "14:105:02mo-rmxx-x01x-xUox:Robust Gold", "14:115:2mm0-Ux1o-ox0x-xxrx:Windy Background", - "15:1122:oxx-0ox-Umx-2m1-r0x:Salty Contest", - "17:1799:m0m-x1U-xo0-xxo-x2r:Imported Gain" + "17:1799:m0m-x1U-xo0-xxo-x2r:Imported Gain", + "19:1825:oxx-0ox-Umx-2m1-r0x:Salty Contest", + "23:4720:o21-mrm-x0U-xox-x0x:Ugly Addition" ] \ No newline at end of file diff --git a/src/features/engine/utils/get-next-board-state/get-next-board-state.ts b/src/features/engine/utils/get-next-board-state/get-next-board-state.ts index a2dee70..b51ed8e 100644 --- a/src/features/engine/utils/get-next-board-state/get-next-board-state.ts +++ b/src/features/engine/utils/get-next-board-state/get-next-board-state.ts @@ -36,11 +36,9 @@ const resolve = ({ current, next }: { current: Movable; next: Movable }) => { remove: current as Dice, }); } else { - if (getIsOppositeVector(current.velocity, next.velocity)) { - next.velocity = getClone(VECTOR_ZERO); - } else if (getIsSameVector(current.velocity, VECTOR_ZERO)) { - next.velocity = getClone(current.velocity); - } + next.velocity = getIsOppositeVector(current.velocity, next.velocity) + ? getClone(VECTOR_ZERO) + : getClone(current.velocity); current.velocity = getClone(VECTOR_ZERO); }