AlphavilleNY
September 3rd, 2010, 01:35 AM
Hey, a little while ago I asked for some help at coming up with a memory system for my platformer-game's random level generation, and while I got some interesting solutions, I wasn't able to make them work out, myself. Now, I think I've got a workaround that should do everything I need, and I've already got part of it working in principle.
What I've been doing all this time is destroying an old level map whenever I create a new one. What I'd like to do instead is merely move the old map into the opposite direction the player just went out through. I've gotten part of it working so far with this line of code, for example, when the player exits via the left side of the screen:
this._x += Stage.width;
Simple enough. Problem is, when I do this it obviously moves everything away, including the player and the new level that's just been generated. I'd like to simply move the old room, but I've been unable to make it work by simply substituting the name for my tile-map array in for "this". Somehow I need to give each map a declarable identity to move as a whole in the code, or possibly make each new map an addition to the level which is moved around the player.
I suppose what I'm trying to come up with is cellular room scrolling, or something to that effect.
What I've been doing all this time is destroying an old level map whenever I create a new one. What I'd like to do instead is merely move the old map into the opposite direction the player just went out through. I've gotten part of it working so far with this line of code, for example, when the player exits via the left side of the screen:
this._x += Stage.width;
Simple enough. Problem is, when I do this it obviously moves everything away, including the player and the new level that's just been generated. I'd like to simply move the old room, but I've been unable to make it work by simply substituting the name for my tile-map array in for "this". Somehow I need to give each map a declarable identity to move as a whole in the code, or possibly make each new map an addition to the level which is moved around the player.
I suppose what I'm trying to come up with is cellular room scrolling, or something to that effect.