Seamless Wrapping

This forum is currently in read-only mode.
  • I'm not sure if Construct has a feature for this already or if it's something I'll have to code myself (I really hope not), so I figure I'll ask. I'm trying to create a game where the 'A' and 'D' keys pan to the left and right of an environment. The environment is twice the size of the view the player will have, or in other words, the player will only be able to see half the level at any given time. Would it be possible to have it so that when the player's view reaches a horizontal edge (x=0 or 1600) the view continues through on the opposite side. I don't want to just have the view abruptly shift to the other side of the level, but rather want a smooth panning.

    Help?

  • you could likely do this through trickery. you need the two edges to visually "tile" perfectly with one another. Then you'd atually "teleport" the "camera" to the matching opposite end a the apropriate time...

    I think it would work but will take some time to perfect

  • Use a Tiled Background object for your environment (if it's static), then you could just change the image offset with events accordingly. I have done it before and it works like a charm.

  • I have objects in the environment as well, though. This seems really messy... ehhh

  • Well, we are all talking theory here. If you cared to share a cap, things could get much more specific.

  • I don't have a cap. I wasn't about to start coding something like that without first verifying there wasn't already a built in function that could wrap a view around the edges.

  • Oh in that case you should try to figure something out. There is still the Wrap behavior, which I failed to use properly in a scrolling game. But maybe somebody else has more experience with it.

    I have objects in the environment as well, though. This seems really messy... ehhh

    What do you mean you have objects in the environment? Are we talking about some sort of seamless scrolling background? Your objects (enemies, powerups) or whatever would be seperate objects so I don't really get what's the problem with that.

    You really should try to prototype this. In most cases it can be done in Construct.

  • I'll have to prototype it, because it doesn't seem like anyone knows what I'm talking about.

    I'll try to explain it more comprehensively, but failing that I guess I'm on my own. Essentially the level will be 1600x600 pixels in size (W x H), but the player's view will only be 800x600 in size. When the player is viewing the edge of a level, rather than having it just bump up against the side I'd like for it to wrap around so that if I were to keep moving in one direction it would smoothly pan through the level indefinitely.

    <img src="http://pub.gamingw.net/39880/wrapping.jpg">

    http://pub.gamingw.net/39880/wrapping.jpg

  • this one is for background looping with wrapping, press right key and background will loop indefinetly

    http://www.4shared.com/file/140637397/61a8b6e/backgroundscroll.html

    this could be used for active content looping i guess

    (and could be much improved)

    http://www.4shared.com/file/138306311/b15b6f2b/loopingbackground.html

  • Thanks, however in that example the player moves indefinitely in a direction and would never encounter any of the objects he had already seen again, thus it is not 'wrapping' back around to the beginning.

    Here is an updated diagram: http://pub.gamingw.net/39880/wrapping_1.jpg

    Imagine you have a cut a vertical strip from a 8.5x11" sheet of paper. You draw your level layout on that strip. Now, take that strip, fold it so that one of the shortest edges touches the opposite edge, and tape it. Now when you go through your level you rotate the ring in your hands, and when you get to one edge of the level you are simply back at the start.

  • well, if you wrap everything with the wrap behaviour except the player ,

    and you move everything in opposite direction of the player then it would have that effect.

    but i see the catch, hmm best bet is to try the wrap behaviour

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sounds more like you want the camera to move, not the background.

  • i guess he wants a level of 800 looped indefinetly , and have all the active or interactive objects looped with it

  • The level is 1600x600, the view will be 800x600.

    [quote:1m7ih09l]Sounds more like you want the camera to move, not the background.

    Sorry, did I state otherwise?

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