Show frame depending on distance to center

For questions about using Classic.

Post » Thu Dec 10, 2009 2:55 am

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).

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.
B
3
S
2
G
3
Posts: 628
Reputation: 2,531

Post » Thu Dec 10, 2009 2:11 pm

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.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Thu Dec 10, 2009 6:07 pm

Thanks Davioware, I'll have a go with that! :)
B
3
S
2
G
3
Posts: 628
Reputation: 2,531


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests