I'm making a top-down game much like The Legend of Zelda and I'm not sure how I should design collisions.
Here's what I've done so far:
– import an image containing all my tiles;
– add a tilemap object to my layout;
– add an instance of that tilemap on layer 0;
– add another instance of that tilemap on layer 1;
– fill the tilemap on layer 0 with tiles that don't collide;
– place the tiles that do collide on the layer 1 tilemap;
– add the player's sprite on layer 1;
– add "solid" behavior to the tilemap instance on layer 1;
– add "8-direction" behavior to the player's sprite.
Now what happens is that my sprite can't move at all... unless I delete layer 0. Then and only then, the "8-direction" behavior acts as intended, the sprite moves and collides with the tiles on layer 1.
How can I keep the tilemap instance on layer 0 while having my sprite ignore it when it comes to collisions? I didn't set a "solid" behavior on that tilemap instance. But my guess is that Construct checks for collisions with that tilemap anyway, because it's an instance of the same tilemap object to begin with – thus the sprite being unable to move, as it's on top of / inside some tiles which aren't meant to collide with it.
So what should I do? I'm thinking of having two different tilemap objects, one used on layer 0 only and the other used on layer 1 only. They should be allowed to use the same image file no matter what, so I guess I won't end up with twice the same image in my project... Is that correct or did I miss something?
Thanks for your help!