SQOTD Alpha, layers, overlap ?
beaudoin_n
Member Posts: 184
Stupid question of the day alert !
Yes sorry about that, i had a lot of advancement on my game today, i set up my actors simple as having color and text being the normal actor square.
Now sometimes when they overlap each other i see the one i am moving, other times it gets hidden behind what it moves.
Is this something to do with Alpha (which i don't have a clue what it does)
Having some way of setting up actors ?
Or other ?
As far as i know there is nothing special about an object versus the other since they are copies (just color and text differ)
Thanks all
Yes sorry about that, i had a lot of advancement on my game today, i set up my actors simple as having color and text being the normal actor square.
Now sometimes when they overlap each other i see the one i am moving, other times it gets hidden behind what it moves.
Is this something to do with Alpha (which i don't have a clue what it does)
Having some way of setting up actors ?
Or other ?
As far as i know there is nothing special about an object versus the other since they are copies (just color and text differ)
Thanks all
Comments
If spawning, make sure you spawn them appropriately in front/behind of spawning actor's layer or the layer itself (they are settings in the spawn command).
I'm guessing it is the second issue as most who are new don't get into the layers much from the start. I could be wrong though, so adjust accordingly.
Where is it that i can see the layer they are on ?
I put them all on the grey part and then i move them to the play area so they are instances that are added. ( i per actor) is this the right way to do this ?
In a scene, at the top of the area on the left you will see "Game" and "Scene" bar buttons. Click "Scene" and then the layers show up. You can add layers with the "+" (and remove with the "-"). You can then drag actors between the layers. They are top down with to being the layer closest to the camera (i.e. the viewer/player of the app). So "background" should stay on the bottom.
You could create two more on top of "background" called "EnemyLayer" and then "PlayerLayer" placing the actors appropriately. Then the player will always be on top. Your collisions should still work in such a situation.
When you add scores, HUD/map, messages, you usually add another layer (or two) on top of all the others and call it "Scores" or "HUD" or whatnot.
Another (probably better) way would be to have a spawner object that controls the selected actor and by control, I mean when one of the actors (i.e. a game piece) is selected, save some attributes, destroy it, and then have the spawner re-spawn (using the saved attributes) the actor to "just behind" the spawner. Having the spawner always spawn the actors initially as well as managing the currently selected actor will ensure the lastest spawned actor to always be on top.
The downside to these two methods would be how do you retain a mouse/touch control of the selected actor between destroy/re-spawn.
Maybe there is another way that others have bumped into? I'm still a bit new to the engine as well and may also just be dense at the moment! :-)
Let's hope it won't prevent people form playing