# Logic flow problem

**URL:** <https://forum.kirupa.com/t/logic-flow-problem/307350>\
**Category:** Uncategorized\
**Created:** [April 2, 2010, 12:40am UTC](https://forum.kirupa.com/t/logic-flow-problem/307350 "2010-04-02T00:40:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexWD](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@AlexWD](https://forum.kirupa.com/u/AlexWD)\
**Post date:** [April 2, 2010, 12:40am UTC](https://forum.kirupa.com/t/logic-flow-problem/307350/1 "2010-04-02T00:40:06Z")

</div>

I’ve hit a bit of a snag with some of the logic for a game I’m creating, perhaps someone here can help.

In the game you can move around a map, when you move the map and the objects on the map is the only thing moving, so you’re always centered. For this reason I decided to separate things into 2 layers (Sprites):

1. You
2. Everything else (other people, objects, the map, etc…)

Now this seemed like a good idea, because when you move I can just tween the the second layer as a whole. The only problem is every time certain events happen (ie. a player moves) I need to reorder all the objects to make sure everything is layered correctly. But this won’t work because… lets say for example:

Layer 1: You  
Layer 2: Person 1, Person 2, Person 3

Say I need to to layer things in the order of: Person 1, You, Person 2, Person 3, it’s impossible to place Layer 1 somewhere in the middle of Layer 2.

So does anyone have any ideas on how I could do this instead?

This is hard to explain, so if you didn’t quite follow, or think I didn’t do a good enough job of explaining post and say so and I’ll try my best to clarify.
