Infinite scrolling on the y-axis without using wrap
Hello,
I am wanting to create a game in which you are to weave in and out of on coming traffic.
The players car is constraint on the y-axis so obviously to create the illusion of motion the background has to move downwards so the car looks like it is moving forward.
However when I use wrap y all of the other actors are moving with the wrap even though they are on different layers and aren't scrollable.
Is there a rule I can use for the background so it has a fluid motion independent from the other actors?
Thanks
I am wanting to create a game in which you are to weave in and out of on coming traffic.
The players car is constraint on the y-axis so obviously to create the illusion of motion the background has to move downwards so the car looks like it is moving forward.
However when I use wrap y all of the other actors are moving with the wrap even though they are on different layers and aren't scrollable.
Is there a rule I can use for the background so it has a fluid motion independent from the other actors?
Thanks
Comments
-change attribute self.position.y to 480
depending on the size of the actor you'll have to play around with the numbers a little, but that will make it when the actor reaches the bottom of the screen it will change to the top
Thanks a lot for you comments and ideas!
tvapps - thats what i am trying to achieve, I am not sure how to make the background loop for an infinite amount of time so it appears the main_player is moving (but having the player actor remaining stationary). I tried using wrap but when the other cars are randomly spawned they wrap back as well, so I don't particularly want to use that.
JohnPapiomaitis - thanks for your comment also. But what I am wanting is to have the main character stationary but the background moving, could the background use the rule instead or was that what you were getting at?
Thanks again
Thanks JohnPapiomitis - I used your suggestion for the background and it works! Had to tweak the numbers as you said and it works perfectly!
Thanks again to both!
Cameron
___________
www.HoneyTribeStudios.com