elmadev / elmajs

Elasto Mania NPM package
https://elmadev.github.io/elmajs/
MIT License
8 stars 5 forks source link

Flower and apple at same time counts as NoTouch #382

Open sunehs opened 2 years ago

sunehs commented 2 years ago

There seems to be an issue that if you touch flower and then pick last apple it counts the run as not finished (NoTouch).

From debugging the code it looks like the apple take event is last and the code checks only the last event. May have to check if there's other events also at the same time. Check this level and rec:

https://up.elma.online/u/eo497yn1xi/foodtest.lev https://up.elma.online/u/9cyonu0cc3/foodtest.rec

Last four events in rec looks like this:

{ "time": 1.700025599992275, "touchInfo": 2, "type": 0, "groundInfo": 0 },
{ "time": 1.700025599992275, "touchInfo": 4, "type": 0, "groundInfo": 0 },
{ "time": 1.700025599992275, "touchInfo": 4, "type": 0, "groundInfo": 0 },
{ "time": 1.700025599992275, "touchInfo": -1, "type": 4, "groundInfo": 0.9900000095367432 }
sunehs commented 12 months ago

To add to this, if you touch flower early in replay with apples left and then take apples it counts as 0 apples regardless of how many you take.

https://up.elma.online/u/gg4oype7yd/LC408.lev https://up.elma.online/u/937e1rbwci/lc408one.rec https://up.elma.online/u/bgmaph64jr/lc408oneNoFlowe.rec https://up.elma.online/u/oylqjksigd/lc408finish.rec https://up.elma.online/u/6jnf83rbtd/lc408finNoFlowe.rec

lc408one.rec touch flower, one apple, death: { finished: false, time: 22433, reason: 'NoTouch', apples: 0 } lc408oneNoFlowe.rec one apple, death: { finished: false, time: 18566, reason: 'NoTouch', apples: 1 } lc408finish.rec touch flower, five apples, finish: { finished: true, time: 66807, reason: 'Touch', apples: 0 } lc408finNoFlowe.rec five apples, finish: { finished: true, time: 86896, reason: 'Touch', apples: 5 }

culinko commented 7 months ago

I found some more cases with DNF misdetection, hope it's okay to add them in here: