Moving Entities and visuality


(Bimbamm) #1

Hi everyone, I could need some help or hints. I have two Entities with different images. Let’s take a ball and a box with a hole. The ball falls into the hole. To simplify things the ball spawns in the air and falls into the hole. The ball should be visible when overlapping the box itself but not visible when falling through the hole. I made a sketch to show you what i mean http://imgur.com/8Jv8ASy. So far i cannot use different layers since the ball would disappear behind the box , not reaching the hole.

Since I do not know how else to solve this I split the box into two entities and assign two different layers. One part overlaps with the ball the other not. But this spawns other issues and seems to be a really inefficient way to do it. Any help is appreciated.


(Jacob Albano) #2

There’s nothing inefficient about that approach; it’s just what I would have recommended.


(azrafe7) #3

Depending on how you want the ball to behave your current solution (as confirmed by @jacobalbano) could be the right solution.

But this turns into an interesting problem if mechanics/physics get a little more complex…

If the ball is supposed to bounce around and against the box edges, I think you’ll have some trouble setting your hitboxes properly (unless you implement a custom collision function). Especially with the current faked 45° oblique projection.

More insight on what you want to achieve might help in clarifying things though, would you mind to provide some more info?

Nice sketch by the way! :wink: