Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Phuzz on February 03, 2015, 02:58:44 AM

Title: Endless Terrain
Post by: Phuzz on February 03, 2015, 02:58:44 AM
Hello,

I am working on a pixel art Game, The Ground is basically 8 tiles that never end moving towards the left of the screen, right now im using a tween action where upon reaching a block outside of the left of screen, to set position to a block on the right side of the screen and continue moving left, I am sure there's a common more practical way of doing this, but i cannot find a guide.

If you want an example, the game "Buff Knight" on android, something like the ground in that game.

Thank you
Title: Re: Endless Terrain
Post by: Fahrettin on February 03, 2015, 04:06:31 AM
I tried to do that for simple car game but i had problems with my car movement.
I made 3 roads. They had 2 Box Colliders. 1 for spawn 1 for despawn. It worked good. I want to help people but i am noob :D
Title: Re: Endless Terrain
Post by: richardh on February 03, 2015, 06:18:27 AM
I set something up like this for my Starwars test game. Although my game has the track coming toward the player over the horizon but the principle is the same.

My player is actually stationary but can move left, right, up & down (can't move forward or backward.

What I did:
I created several versions of the same track (each with different obstacles) and saved them as prefabs (track1, track2, track3 etc).
Outside of the camera/screen view I created an empty spawn point. This was set up to wait for a set amount of seconds and them spawn/create one of the track prefabs on a random float. So sometimes it spawned track4 next track2.. track7 etc.. This gave a never ending and random 'track' coming toward my player with very random obstacles. The track prefabs were tagged as 'obstacles' (which is what they were in my game) and I set up trigger point behind the player (out of camera/screen view) which waited until a gameObject with the tag 'obstacles' entered and then destroyed then.