0 votes

Hello people.
I just started learn Godot and i want to make simple game.
Now, i need to create a grid 6x6 with blocks and move to upward them smoothly. Wherein i need to create new row of blocks under that grid and that it was happened constantly. That is moving up then new row under them, moving up -> new row.!
BlocksGrid
with this code that i writed myself:

for(int i = 0; i < row; i++)
    {
        for(int j = 0; j < col; j++)
        {
            int rndColor = rnd.Next(3);
            PackedScene rect = rectArray[rndColor];
            rectInstance = (RigidBody2D)rect.Instance();

            rectInstance.Position = new Vector2(SpawnPosX * i + 200, SpawnPosY * j + 360);

            AddChild(rectInstance);
        }
    }

But if i trying move the blocks then only last block is moved.
How is better to make what i want? Sorry for my English.

in Engine by (12 points)

could you please show a screenshot or picture of exactly what's happening and what do you want to achieve?

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.