Aligning actors in layers for a pseudo-3d environment
dunkelgeist
Member Posts: 68
Hi again!
I have another question for the great minds that surround us!
I'm setting up a scene like this:
https://docs.google.com/leaf?id=0B-pHlLMaonDjZmM0ZTBlZWItODJmZC00ZmQ1LWI0ZTMtMWM0NGE2M2MyZDVj&hl=es&authkey=COHcmtgE
BUT! and it's a big BUT... I can't get the actors to align as I like, if you see the precious drawing, I would like to set actors front or back of each other depending of their Y position, so the higher they are on screen, they have to be at back of others.
In the image, ordered from front to back it should be like this: III - II - I
It's driving me crazy... any suggestions?
Thanks!
I have another question for the great minds that surround us!
I'm setting up a scene like this:
https://docs.google.com/leaf?id=0B-pHlLMaonDjZmM0ZTBlZWItODJmZC00ZmQ1LWI0ZTMtMWM0NGE2M2MyZDVj&hl=es&authkey=COHcmtgE
BUT! and it's a big BUT... I can't get the actors to align as I like, if you see the precious drawing, I would like to set actors front or back of each other depending of their Y position, so the higher they are on screen, they have to be at back of others.
In the image, ordered from front to back it should be like this: III - II - I
It's driving me crazy... any suggestions?
Thanks!
Comments
Don't know if that gives you something to work with. I know Darren has a video of that working in his template pack.
Maybe Darren could explain it in a few words to make it work by my own hands, that's a 'Pleaaaaaseeeeee' xD
I don't even know if his template could be useful for me as my actors are moving constantly.
Thinking of what you said, maybe I can add a layer for, let's say every 10 pixels to make it look a little realistic but that will involve so many rules...
Also I'm still able to change the gameplay and make it full top-down but that's not so cool with the game mechanics I've worked on.
Still thinking...
i think that will work, but i haven't tried it
That's a nice idea... Not sure how to fully implement it but I'll try after work.
Thanks!
The thing is I can have an undefined number of actors moving around, up to 5 or so...
If it was only for one actor i've found it relatively easy to spawn and destroy on different layers but here there's much more movement.
I spent some time on this issue this afternoon, and will add a new wiki page to show details. One way to do this that doesn't involve ANY spawning or destroying is this:
Create a second, identical actor. Place one on a higher layer, one on a lower layer. Create a game-level real attribute for each of your actors, and constrain it to the Y-value (position) of that actor.
Now, as you move your actors around, have a rule that checks whether the Y value is lesser or greater than the actor you want to move in front of or behind of. Have your identical actor exactly match the movements of your main actor. If the Y value is less, change the alpha value of the one actor to 0 and the other to 1; if the Y value is more do the opposite.
Basically, you'll have one actor visible above certain points, and the other visible below certain points.
This may not be the best way to do it for your project, but it's one possible way of handling things that doesn't require any spawning or destroying. Here's the wiki article:
http://gamesalad.com/wiki/how_tos:multilayermovement
It really isn't perfect for my game as it is but it's easily adaptable.
That, a little actor detecting collision just at feet size and an interpolation of size as the characters get far from bottom will make it soooo cool!
Thanks again!!! Now I've got a lot of work to do
My mate Jake and I were discussing this just today! Crazy, eh?
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io