Discuss Scratch
- Discussion Forums
- » Bugs and Glitches
- » Strange Collision Glitches with Bitmap Sprites
- sylvie_ln
-
Scratcher
1 post
Strange Collision Glitches with Bitmap Sprites
My browser / operating system: Windows NT 10.0, Firefox 64.0, Flash 32.0 (release 0)
https://scratch.mit.edu/projects/279893922/
Here is a project that demonstrates some weird collision glitches.
It seems like the collision detection (using the “touching ___ ?” block) when using bitmap sprites is not pixel perfect and has some strange inconsistencies when in certain positions.
Also, it seems like even if a sprite has a symmetric hitbox, flipping it using the left-right rotation style will change the hitbox.
There might be problems with my code I don't know about, but some of the glitches are really strange and don't seem like they could have been caused by a coding error on my end.
Glitches:
- From the start, walk to the right far enough and you will eventually fall down one pixel, even though the floor is totally flat.
- If you slowly walk off the left edge of the topmost floating block, you can get the chicken's tail stuck on the edge, even though the costume used when performing collision checking is a rectangle. This doesn't seem to happen with the other two floating blocks!
- Jump into the very top right corner and there is a strange invisible bump. While standing on the invisible bump, if you turn around to the left, you will fall through the bump for some reason even though the hitbox is symmetric.
Here is a GIF demonstrating each of the glitches.
http://love-game.net/glitches.gif
https://scratch.mit.edu/projects/279893922/
Here is a project that demonstrates some weird collision glitches.
It seems like the collision detection (using the “touching ___ ?” block) when using bitmap sprites is not pixel perfect and has some strange inconsistencies when in certain positions.
Also, it seems like even if a sprite has a symmetric hitbox, flipping it using the left-right rotation style will change the hitbox.
There might be problems with my code I don't know about, but some of the glitches are really strange and don't seem like they could have been caused by a coding error on my end.
Glitches:
- From the start, walk to the right far enough and you will eventually fall down one pixel, even though the floor is totally flat.
- If you slowly walk off the left edge of the topmost floating block, you can get the chicken's tail stuck on the edge, even though the costume used when performing collision checking is a rectangle. This doesn't seem to happen with the other two floating blocks!
- Jump into the very top right corner and there is a strange invisible bump. While standing on the invisible bump, if you turn around to the left, you will fall through the bump for some reason even though the hitbox is symmetric.
Here is a GIF demonstrating each of the glitches.
http://love-game.net/glitches.gif
- gor-dee_test
-
Scratcher
100+ posts
Strange Collision Glitches with Bitmap Sprites
My browser / operating system: Linux, Chrome 71.0.3578.98, No Flash version detected
Yes I see the same. I don't have time to check all your code but it looks pretty sound at first glance.
Your post caught my eye because I'm also getting a collision glitch on a project that worked fine in 2.0. I'm trying to make a small demo project but so far I can't recreate the bug….I'm also using bitmap
Yes I see the same. I don't have time to check all your code but it looks pretty sound at first glance.
Your post caught my eye because I'm also getting a collision glitch on a project that worked fine in 2.0. I'm trying to make a small demo project but so far I can't recreate the bug….I'm also using bitmap
Last edited by gor-dee_test (Jan. 16, 2019 01:58:35)
- gor-dee
-
Scratcher
1000+ posts
Strange Collision Glitches with Bitmap Sprites
I've made a project here https://scratch.mit.edu/projects/276669573/ that demonstrates quite a few oddities.
- When you convert a 16x16 bitmap square to vector it shows 17x17 in the costume editor
- by putting text in the vector costume it's size changes…it shows as bigger and SMALLER as you change the shape of the text (text always smaller than costume)
- “touching” changes if you are in small/fullscreen, if you are in vector/bitmap, if you have just changed from vector to bitmap etc.
- it's possible to have two sprites touching with one sprite reporting it is touching and the other not!
- “see inside” and the costume changes shape when switching vector/bitmap
Last edited by gor-dee (Jan. 17, 2019 23:01:03)
- colinmacc
-
Scratcher
1000+ posts
Strange Collision Glitches with Bitmap Sprites
Yes I had a similar problem with my pac snake game in 3.0
In the project I'm very careful the head of the snake only moves at 16 pixel intervals so it doesn't hit the edges prematurely. I had to change the background from vector to bitmap to get it to work properly, it seems the vector had a “fuzzy edge” that triggered collisions when they shouldn't have been.
In the project I'm very careful the head of the snake only moves at 16 pixel intervals so it doesn't hit the edges prematurely. I had to change the background from vector to bitmap to get it to work properly, it seems the vector had a “fuzzy edge” that triggered collisions when they shouldn't have been.
- Discussion Forums
- » Bugs and Glitches
-
» Strange Collision Glitches with Bitmap Sprites



