Effect of different widths on overlapping features, what am I doing wrong?

In my game, I have three differently-sized pink straight-line sprites:
one with a size of 1x16, one with a size of 1x120, and the otherwith a size of 2x120.

However, I’m encountering an issue where the ‘overlaps’ function doesn’t work when my sprite size is 1x120. But when I create sprites with sizes 1x16 and 2x120, the ‘overlaps’ function does work.
image

What I want is for the ‘overlaps’ function to destroy the overlapped ‘badGuy’ whenever any size of player sprite overlaps it."

Here is the link to my test project:https://arcade.makecode.com/S01986-07977-86647-19137
How can I resolve this issue? Thanks in advance.

1 Like

Wow, this was a difficult challenge, at least for me, who exhausted my attempts to wrap my head around around a solution…

It is such a trivial example that really should work well, and I am starting to suspect that this could possibly be some kind of small bug and/or maybe a case for the the experts, like @jwunderl, @richard, @shakao and others at the @makecode team?

Has it to do with any of these subjects?:

https://forum.makecode.com/t/problems-with-overlap/16442/3
https://forum.makecode.com/t/how-to-debug-performance/8681/2

That’s fascinating. I’ll share with the devs and see if we can figure out what’s happening here.

2 Likes

Gets even more fascinating! Look what happens a minute or less into the program…:
Fascinating

Can’t let it go… Just tried all the way back to v0.9. Almost same result, some versions destroying some sprites further behind, but never exactly on overlap… I give up now.

…well i can tell you why the game slows down after a minute! you’re not destroying any of the sprites!

once you get to huge numbers of sprites the game engine will slow down.

1 Like

the missing overlaps behavior certainly seems like a bug. i bet it’s something to do with rounding errors… might explain why the slower game causes the overlaps to fire at certain x values.

1 Like

True! I experimented with less frequent game updates and slower moving BadGuy sprite, and that got more hits and sprites destroyed, but not all.

Glad and hope you are onto something with the rounding or whatever this might be! :wink:

Did you file this, @richard?

no, feel free to file it!

Ok! -On the condition that it gets assigned. Deal? :wink:

i can’t guarantee that we’ll work on any issue immediately!

we’re working on an update for another MakeCode editor at the moment so arcade issues won’t be prioritized until after we’re done with that release.

2 Likes

Filed: