Jump to content

Sprite layering


Meowts
 Share

Recommended Posts

Hi,

 

A little layering problem I'm not quite sure how to solve.

 

Here's what I'm working with: http://i.imgur.com/VOV9jpX.png

 

What I want to happen is that when the man is sent into his doom (into the water), he will go in front of the first two water layers and behind the third water layer.

 

The sprites are layered as such:

- Water1

- Water2

- Water3

- Land

- Man

 

The trouble is that the Man needs to be placed after the Land, so that he's standing on it. But the water needs to be placed before the land, since there are tween animations that make the water move back and forth. I have a feeling that sprite groups will be used here, but I'm not sure how to make it work for this purpose. Any suggestions?

Link to comment
Share on other sites

bringToTop would work, so would checking the original draw ordering. If certain things need to be 'behind' of other objects, create (game.add) them first. The drawing order, unless changed by bringToTop, works from the order they were created. Often, it can be enough to make the player-controlled object to be the last game.add in order and 'on top' of the other drawn items.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...