Hi, I have two problems.
1) I need to check if there's sufficient free space for a sprite to spawn another object right next to it (horizontal, vertical and diagonal directions). So, if there's enough space and no existing sprite in that area, sprite will be spawned. If there is already a sprite in the immediate 64x64 pixel area (size of each sprite) next to the spawner sprite or there's not enough space for spawn in that direction in the layout, object cannot be spawned. Something like this:
Spawner sprite (also 64x64 px) should first try to spawn another sprite horizontally to its side (in its facing direction), then if that's not possibly try to spawn diagonally, then last vertically. I should mention game is not locked to a grid-based movement. How would I go about achieving this? I've been trying to solve this for two days now so any help would be greatly appreciated:)
2) I have a sprite that's moving using platform behavior that I need to attach a weapon to. I can do this either by pinning it to the platform behavior sprite or setting the position of the weapon each tick. I don't want the weapon sprite to pass through walls, so I've given it a solid behavior. However, it still passes through the walls anyway and the solid behavior also creates another problem, preventing normal movement to the direction weapon is attached to. Here's an example capx:
What would be the best/recommended way to fix this and have the weapon not affect the normal movement and also stay within the wall boundaries. I need a solution to have the platform sprite "respect" the collisions of the weapon and not be able to move any further in the direction weapon is about to overlap with a wall. Any ideas?