playMaker

Author Topic: Endless Terrain  (Read 1878 times)

Phuzz

  • Full Member
  • ***
  • Posts: 101
    • Bzilla Games
Endless Terrain
« 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
Bzilla Games "Education with a Tickle!"
Qbucket Games "Voxel Games"

Fahrettin

  • Junior Playmaker
  • **
  • Posts: 62
  • Noob
Re: Endless Terrain
« Reply #1 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

richardh

  • Junior Playmaker
  • **
  • Posts: 97
Re: Endless Terrain
« Reply #2 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.