A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Layering Problems

  1. #1
    Hi all

    I am making a game - similar to Pacman. There is a maze populated with little dots that Pacman picks up as he wanders round.

    Anyway I have noticed that the dots seem to be on a higher layer than pacman even though pacman is on a higher layer.

    Is it something to do with the depth value when I create the dots using duplicate movie clip? Basically I create 400 duplicates with first with a depth of 1 and the last 401. I am not sure what this depth refers to - Is it the layer? If so then how can I make Pacman go on a higher layer - do I need to put in 400 empty layers - i hope not. Or is there a command to set the layer of Pacman to say 405?

    http://www.thegamesfactory.f2s.com/B.../Pacman3_0.htm

    Any help much appreciated

  2. #2
    Member
    Join Date
    Apr 2000
    Posts
    40
    I would duplicate the pacman movieclip and set the depth of the duplicate to 405. You can then use the duplicate instead of your original pacman, and it will be above anything with a depth less than 405.

    I hope this helps,

    Rob

  3. #3
    Thanks

    I thought of doing that - the only problem is that I have all the code controlling Pacman on an on enterFrame clip event attached to the Pacman movie clip. Therefore if I duplicate him, I will have 2 Pacman movieclips wandering around the screen. Even though I put the original off screen he may wander back on if the right direction sequence occurs.

    Shame I couldn't remove the original after duplicating it.

    Anyone?

    Paul

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Posts
    105
    Just an idea (- I have never used this so I may have it wrong):

    Could you use the swapDepths() function to swap the depths of your pacman mc and the last (highest depth) dot mc?
    That way you pacman is always on top of the dots.

    check out the help files for info on swapDepths

    bangers

    PS.
    I saw the game, looking good

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center