How to Make a Game Like Circle?

Dear Readers,

I am really interested to make a game like Circle.

The Problems I’m having:

  1. How to Generate the zig zag line
  2. How to place the diamonds
  3. How to Place the ring, whether it can be 2d or 3d?

Please if possible for infinite line, I need a fully commented code.

You probably won’t get a fully commented code from many people as it’ll take time & effort, but i can guide you in the rightish direction.

1 - Generate a bunch of positions along the x in a grid apply perlin noise to them on the y.
2 - In a script have something that builds the mesh along the generated positions.
3 - Then instantiate random diamonds along the generated positions.
4 - Then instantiate the ring at the very first position.
5 - You’re on your own.

Your friends if nobody’s willing to write you a full script & you’re stuck by yourself, trust me reading will get you places :

Unity - Scripting API: Mesh - For Procedural Mesh
Unity - Scripting API: Mathf.PerlinNoise - For Noise
Unity - Scripting API: Object.Instantiate - To place diamonds/ring
Unity - Scripting API: Rigidbody - For ring physics or you can write your own

Bro, I tried following the links you gave me.

We just need a script, which generates endless line with random value on y, thats it.

So thats all you need, well if you don’t meet us half way in trying to teach you how, why should we do all the work for you, for nothing?

What you probably want is to draw vector lines, unfortunately, Unity doesn’t do that. Google it and see what you come up with. You could use a debug line, but you’d have to publish in debug.

Since the game doesn’t need to be a copy, I think I would make little spherical sprites that were very close or touching each other for the path, or you could make long rectangles that were rotated and connected. The point is, use the game as your starting place and then let it evolve as you try different things. When you come here, ask for something more specific, like why a piece of code doesn’t work or to point you in the direction of doing one specific thing.

Bro, I am sorry but I tried my best to code but didn’t get anything.

I am just figuring “How to make zig zag lines in unity” may be I am dumb, but i need help.

Take a look at the Vectrosity. Not free, but absolutely worth the price of admission.

But then we need to change the y value too

The simple answer here is that you are over your head and need a simpler project.

        Mesh m = new Mesh();
        int length = 100;
        float height = 0.2f;

        Vector3[] verts = new Vector3[length*2];
        for(int i = 0; i < length; i+= 2){
            float x = (float)i;
            float h = Random.value;
            float z = Mathf.PerlinNoise (x,h);
            verts[i]  = new Vector3(x,z,0);
            verts[i+ 1]  = new Vector3(x,z - height,0);
        }

        m.vertices = verts;
        int[] tris = StripToIndex (0,verts.Length,false);
        m.SetTriangles (tris,0);
        m.RecalculateBounds ();
        m.RecalculateNormals ();
        m.Optimize ();

        this.GetComponent<MeshFilter>().sharedMesh = m;

Still kind of incomplete but its an example that you can work with. You need StripToIndex from Where did triangle strip go? - Unity Engine - Unity Discussions