Collisions and Scrollable Layers
Can collisions be detected properly on actors that are on scrollable and non-scrollable layers?
I'm moving my the camera to make my scene pan left and right. I've created a camera offset actor so I can drag and drop actors in the scene, which works properly.
However, when I an actor on my scrollable layer and drop it onto an actor on my HUD layer (which is NOT scrollable), Gamesalad doesn't detect the collision.
Please help!
I'm moving my the camera to make my scene pan left and right. I've created a camera offset actor so I can drag and drop actors in the scene, which works properly.
However, when I an actor on my scrollable layer and drop it onto an actor on my HUD layer (which is NOT scrollable), Gamesalad doesn't detect the collision.
Please help!
Comments
The reason I needed this solution is because I wanted to create a scrolling layer with draggable items on it. When the player wants to add an item to his inventory, he drags the item onto the drop-zone on the HUD layer (which doesn't scroll and is always in the upper right of the screen), and adds the item to his inventory.
Here's how I did it:
I created an Invisible Actor on the same layer as my draggable objects. Then I made two Real game attributes (DropZoneX, DropZoneY) and constrained them to the X & Y positions of the HUD drop-zone + the Camera Offset attributes. Next I constrained the X & Y positions of my Invisible Actor to DropZoneX and DropZoneY.
Now when I test the collision of the draggable items and the invisible item, it works flawlessly.
http://gamesalad.com/game/18930