I am using collision(#LAYER, id1 ,id2) and i ran into something i didnt want to happen.
I have used HideLayer() for id2, and when i do collision check between id1 and id2, it detects it as collision despite the id2 being hidden.
Is there a way to check for collision so that if one of the layers to be checked is hidden, it wouldnt report true then?
I can make workaround for this of course, but i would prefer if there would be command that would handle this for me.
can Collision check avoid colliding with hidden layers?
Re: can Collision check avoid colliding with hidden layers?
I use the trick just not to hide a layer but move it to offscreen outside screen boundarys (above, left, right or down of it).
Re: can Collision check avoid colliding with hidden layers?
but then there comes the problem that you need to know the location where the layer is supposed to be displayed at.
I only put the layer to its place at beginning, after that i only keep hiding and showing it, without any knowledge where the actual x and y are supposed to be at.
I only put the layer to its place at beginning, after that i only keep hiding and showing it, without any knowledge where the actual x and y are supposed to be at.
- airsoftsoftwair
- Posts: 5887
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: can Collision check avoid colliding with hidden layers?
Well, just write a wrapper function that checks the #ATTRVISIBLE attribute of the layer and only calls Collision() when both layers are visible.
Re: can Collision check avoid colliding with hidden layers?
Ah, that didnt come to my mind. Thanks Andreas!