Hi everyone,
I’m working on a virtual pet app using MIT App Inventor, and I’ve run into a strange issue that I’ve spent the entire weekend trying to solve.
I have an ImageSprite (named Pollito) inside a Canvas.
Draggable is enabled.
The user can drag food sprites (like Pollito) to the pet (ImageSpriteSnark), and when they collide, the pet reacts.
The problem:
After the first collision and repositioning, Pollito starts moving on its own, even when I’m not touching it. It’s like it thinks it's still being dragged, even though I’m not interacting with it.
I’ve tried:
Replacing the sprite with a new one
Rebuilding the logic
Using set Velocity and set Direction to 0
Looking for a way to disable/reenable Draggable via blocks (which seems impossible — I understand now there’s no block for that)
Resetting origin and interval
Triggering repositioning via a Clock timer to avoid instant update
Testing in different browsers and devices
This a known bug? Is there any reliable way to reset an ImageSprite’s drag state after moving it with code? Or is there a workaround to force the drag state to stop?
Mr.ABG, Your article about avoiding sprite cannibalism was partly helpful, but now the main problem remains that after dragging a sprite (food) to the pet sprite, and after waiting a few seconds, the food sprite automatically drags itself to the pet sprite.