Bird's-eye perspective problem

0 favourites
  • 5 posts
From the Asset Store
Fully animated four directional eye monster game asset
  • I am trying to:

    I'm trying to have perspective work properly in my 2D 2.5D game, which uses the bird's-eye view.

    I have tried:

    I've tried using the following scripts:

    And here are the details to each one (You don't have to read them):

    The first one only works for the first instance of the tilemap 'house'; it doesn't work at all for the rest in the layout; when the player is in front of the house, it's actually behind it.

    The second makes use of two parts of the same tilemap, the front and the back, which the front is a container of the back (so both will be destroyed when either is) and the front is on a lower layer than the player's and the back is on a higher layer than the player's. However, I've encountered essentially the same problem, but with the player on top of the back despite even putting that on top of the layer.

    The third has the front and back not in a container, and thus with them on the same layers, perspective works fine. It also uses a third sprite, called 'HouseConnect', so it would supposed to be that when the house front was destroyed, it would set an instance variable in 'HouseConnect' to true, which in turn would destroy the house's back if it was also overlapping it.

    This works if one instance of 'HouseConnect' were connecting the two sides and it wern't a part of HouseFront's container. However, if there was more than one of such instance connecting all four houses, clicking one 'HouseFront' would destroy all HouseConnect's and HouseBack's, while having the latter although would do the same thing for having all four houses connected, clicking one HouseFront would destroy that and in fact HouseConnect, but not HouseBack.

    I needed HouseConnect because I can't have a tilemap detect if it's overlapping another object, like I can with sprites.

    Summary:

    This is likely a lack of knowledge of how instance picking works. I do know that if I, for example, used a condition to detect if one object was overlapping another, it would destroy that instance only, otherwise, the event would destroy them all.

    Google search engine helped me none, and I don't trust this forum's either.

    However, I've been dealing with this problem for at least a month now, and I'm not getting anywhere (with the exception of the next section) with it, so thanks for your help.

    Bonus: Although having the house sides as sprites instead does, in fact, work for having the two destroy each other when the front is clicked and for perspective, regardless of layer, I find the process for getting rid of the background when snipping or taking screenshots of them tedious, and I'm not sure about tilemap editors, since one I've tried couldn't export my map (or any tilemap, for that matter) as an image, and I would have to do the same tedious process in that as well; perhaps there's a less tedious way. Besides, this problem assumes the house sides are tilemaps, so if you have a solution(s) to the main problem either way, please let me know; thanks.

  • To pick in this scenario you need to add a system 'For Each' House condition, otherwise the picked House is always the first instance. What it's doing is moving you in front of the first instance of House every time, even if you are positioned over a different House and won't see it.

  • To pick in this scenario you need to add a system 'For Each' House condition, otherwise the picked House is always the first instance. What it's doing is moving you in front of the first instance of House every time, even if you are positioned over a different House and won't see it.

    I thought the problem was solved already, but here's what I've got:

    The problem with that is if there were houses on different Y levels, if I were above a lower house, the player wouldn't go behind it. I wanted the problem solved for individual houses.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • If you move the 'for each' above the Player condition you'll find it is working.

  • If you move the 'for each' above the Player condition you'll find it is working.

    Ok; gotcha; I had them in the wrong order; both of your solutions I've never realized; I'm relatively new to C2, so you can expect me to ask for help on this sub-forum relatively frequently, but not too much.

    Other than that, to all viewing this thread, this problem is now solved, but I'll keep this in case I encounter another problem with what I have.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)