Show frame depending on distance to center

This forum is currently in read-only mode.
From the Asset Store
Selection frame like in RTS games, works both on mobile and desktop devices.
  • Ok look at this super quick example here

    Firstly, imagine it's seamless, it obviously isn't but you can imagine it is. Also imagine more detail lol.

    My question is. How would you go about creating a sprite or background using frames like that, say for inside a corridor, which would display a particular frame depending on the distance from the center of the screen (in this case on the X axis). So if you move left or right, the frames update to give a more advanced parallax effect, without using layers or the usual tricks, and keeping the effect of objects off in the distance. Hmm not easy to explain really. Basically the sprites would all use a different frame, depending on their position, then each would update to the next and so on, as you moved.

    You can see a similar effect in the second stage of Blazing Star (Arcade).

    <img src="http://www.homemademech.com/Uploads/Greview/32141240788335.jpg">

    Only in that example it continually scrolls. What I'm wanting is sprites that only change when you move left or right and keeps still when the player is. There's probably a really easy way of doing this, but trying to think too clearly while sick, isn't one of my strong points.

  • insert the frames into a sprite object, then always >> set animation frame to total#offrames-player.x%total#offrames I havent tested it, but try it anyways. Anyways, the idea is to have them as sprite frames then work out a formula to display them seamlessly.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks Davioware, I'll have a go with that!

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