Trying to make a looping background
Gamepenciler
Artist/Game DeveloperMember, PRO Posts: 326
Hi I seem to encounter a problem, not sure if i did wrong but I try to do a looping background in ipad size
Actor size is 1024x250
then I have this attribute:
If self.position.x = -512, change attribute self.position.x = 1536
It suppose to reposition at 1536 but it isn't, I think gamesalad cannot reach that value because I tried values inside the display size. Does anyboy have a suggestion?
Actor size is 1024x250
then I have this attribute:
If self.position.x = -512, change attribute self.position.x = 1536
It suppose to reposition at 1536 but it isn't, I think gamesalad cannot reach that value because I tried values inside the display size. Does anyboy have a suggestion?
Artist/Game Developer / Animator at your service..
Best Answer
-
HoneyTribeStudios Posts: 1,792You can change an actor to whatever position you want as long as it no more than 500 px beyond your scene size.
Answers
Try:
When position.x is less than or equal to -512 change position to...(whatever you want)
If you are using the move, accelerate, change velocity or self.motion.linear.x behaviors then you will never have exact positions. That's why you use 'less than or equal to'.
Artist/Game Developer / Animator at your service..
Artist/Game Developer / Animator at your service..
Also make sure your scene is big enough. An actor off the scene by more than 500 px is automatically destroyed.
Artist/Game Developer / Animator at your service..
Artist/Game Developer / Animator at your service..
So just make your scene bigger and move the camera position.
The game will not be played at camera.origin.x of 0.
Instead move the camera origin along by how ever much you want. And this becomes your new play area.
Artist/Game Developer / Animator at your service..
heres your file with the changes.
https://dl.dropboxusercontent.com/u/58782733/loopingBG.zip