Why is my sprite going through another sprite?

Hi, its me again. I was wondering if you could help me with one of my BIGGEST bugs that I am having. And that is getting my sprites to be uncrossable for another one of them. Thanks! here is the file:

EscapeRoom.aia (441.6 KB)

Without looking into your aia: check the speed and interval of the sprite...
from the documentation Drawing and Animation

Interval
The interval in milliseconds at which the ImageSprite’s position is updated. For example, if the Interval is 50 and the Speed is 10, then the ImageSprite will move 10 pixels every 50 milliseconds.

Speed
The speed at which the ImageSprite moves. The ImageSprite moves this many pixels every Interval milliseconds if Enabled is true.

Taifun

When it collides it sets it to both 0 and enables it to false

as said by Taifun, set the imageSprite speed to a small number, to see if this 'going through' happens.

Yes it still goes through.

Well sure, it stops it the first time, but when you click the canvas again, it goes straight through.

If you are asking for help, I recommend you to make it as easy for others to be able to help you ...
You probably will get more feedback then...

which means in your case post a screenshot of your relevant blocks...

To download the aia file, upload it to App Inventor, open it, do some bug hunting for you, etc... this takes time, and most people will not do that...
Thank you.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Ok, thanks!

The very middle is my problem.

In fact I downloaded your aia, found you have 7 screens, and 3 of them are about gaming but different levels and many sprites.
I just found to debug other developer's app is so painful.

This is the only bug I have, and you don't have to fix it. Also, I'm sorry for making you feel that way.

what do you want to achieve by this:
image

Just making the Theif sprite not go through the sprites in the global edges code.

try
when Thief.CollideWith (other)
if other is in list of edges
set thief.speed=0

Nope

use the EdgeReached event for this

EdgeReached(edge)
Event handler called when the ImageSprite reaches an edge of the screen. If Bounce is then called with that edge, the sprite will appear to bounce off of the edge it reached. Edge here is represented as an integer that indicates one of eight directions north(1), northeast(2), east(3), southeast(4), south (-1), southwest(-2), west(-3), and northwest(-4).

Taifun

You wanted to catch the case where the thief is touching the cop, right?

In the event of thief collision with other sprite, test if other=Cop 1

Use the Cop1 component block for the test.

No its not really that but its when the theif collides with the walls and doors.

I see you have a global (name cut off your screen shot) listing sprite components named after walls and doors.

You can use the IS IN LIST block to test if OTHER is in that list,then respond accordingly.