Scrolling Backgrounds for iPad?
Angeloblu777
Member, PRO Posts: 35
I am working on a game for an iPad (1024x768) Landscape mode.
My game has three actors:
Actror nr1 - is stable background,that is fine.
Actror nr2 - hero fallows my finger on the screen, that is also fine.
Actor nr 3 is the problem.It is the ocean floor( 1024x150) a need it to move(scrolling) to the left and to repeat and smoothly connect on the right site.
I found a YouTube video from Jamie Cross but his tutorial is only for an iPhone. His scripts do not seem to work for iPad Landscape mode.
Could somebody please help me out?
Thank You - Anna.
Comments
Hi Anna, those same techniques should work fine on an iPad. If you were to go the route of spawning you'll need to increase the size of your scene because Gamesalad automatically destroys actors when they are 500 pixels off the scene and the iPad screen size is 1024 px wide.
But if you were to scroll using the recycle method you don't have any special concerns, you'd just need to adjust your values for the iPad screen vs the iPhone screen.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Here is a sample of an iPad scrolling using spawns like in the video above. I've left a gap in the image so you can see that it is indeed scrolling.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Thank you Jamie for the demo. I used your scripts in my game but I still have a problem with scrolling my floor. My game has three scenes.Your script only works on scene 1 and there still is a gap. How do I eliminate it? In scene 2 and scene 3 your script does not work. I made an example of my game to show you what I mean.
Use your mouse to move white square. Touch colored square to pass to the next level.
Thank You - Anna.
Here is the example of my game:
@ForumNinja these forums are really getting frustrating. Now it won't let me download the attachments above or any others I have tried. Might be time to give Vanilla the flick they really suck.
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
@Angeloblu777, in your behaviors for the background you'll need to overlap them slightly. I left the gap on purpose so you can tell the background was scrolling. You need to update your Spawn Behavior to and X location of 1536 or less. I'd plan for your backgrounds to overlap slightly, when you are using the spawn technique if you don't overlap them, you can end up with a gap.
The reason I choose 1536 above is because the iPad screen size is 1024 pixels wide, and the center point (0,0) of all actors in Gamesalad is their center point. So you need to spawn your new background the full distance of the scene (1024) plus half the width of your actor/background (which is 1024 pixels wide) so that offset becomes (1024+(1024/2))=1536. If you were using a different scene or background size you'd need to adjust accordingly.
Also in scenes 2 and 3 of the project you attached, the background is scrolling fine for me just like scene 1.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Thank you Jamie for your help. In Spawn Behavior I change x location from 1536 to 1532 and now I don't have a gap any more.
In scenes 2 and 3 I change scene width from 1024 to 1124 and now everything works fine.
I have bought your Udemy course and particles. I learned a lot.
Thank you - Anna.
@Angeloblu777, I'm glad you got it all going. And thank you very much, let me know if you have any questions or problems with either purchase.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page