2D Infinite Runner questions

Alright, guys I’m looking into making a 2D infinite sidescrolling runner game in the new 2D framework.

Here are a few questions I want to materialize concretely into solid answers before I start working on it.

  1. Is it better off to move the background/floor backwards, or move the player forward? I’m going for a jetpack joyride style infinite runner where the player’s X position will be fixed on the screen.

  2. I want to have the game load all the resources ONCE in the starting. I have pro version so I can use LoadLevel Async, but how would I be able to load ALL resources in the start, without having any load time before actually loading the level?

  3. Let’s say I somehow load everything at the start of the game, is it still possible to cycle through a list of gameobjects. For example, for random generation of the floor, I would require a list or array of gameobjects. Generally I would do this by dragging and dropping the required assets into the inspector field. But if I load everything at the start, I am assuming I would have to use a different approach. Could someone please explain how this would work out?

  4. Far saving user data, such as upgrades bought, levels completed, etc. is there a better way (or rather, SAFER way) than PlayerPrefs? I was watching a video tutorial by someone at Unity and he said playerprefs aren’t very reliable as they are stored in a text file on the hard disk. He didn’t specify the alternative though, so if you know how to store data more securely using playerprefs, please let me know.

  1. No, just move the character forward. You’ll link your camera’s X,Y position with the Player, so it will always be centered on the screen.

edit: robertbu brought up a good point, so it’s worth considering just moving the level if you truly plan on this being “infinite”

  1. Unity - Scripting API: Resources.LoadAll

  2. Use LoadAll to load a directory and type of resource into an array:

  1. Yes, use SerializeXML. It offers a lot more freedom.

http://wiki.unity3d.com/index.php?title=Saving_and_Loading_Data:_XmlSerializer

I have a simple answer to your question, maybe it sums it up.

Let the background move while your character justs loops his/her running motion. So, Loop the background while the character “pretends” to be running and randomly generate coins,lasers,and enemies.

Loading is really “needed” for a game to work. If you expect the game to start directly without loading then… I don’t know… Impossible? Most games load all the resources at the beginning. Examples of these are games from valve and the bioshock series. They all have loading screens that will just load the “required” resources.

I think that’s all I have. :stuck_out_tongue:

iKatsuX3

Hey If you are looking for 2D Endless Running with Jumping, I had found a reference game: “Mojo Run” from the Unity asset store.

Hope it helps you… Thanks…