It's Vector work...

... Not to me, Not if it's my game.

Yesterday and today were spent translating the code of the Grid and of the Building parts from 2D to 3D. Changing the Grid from a dict of Vector2 to a dict of Vector3 was easy enough. Since the camera looks toward -Z, it perfectly reproduces the 2D axis with that Y going down. UP and DOWN becomes FORWARD and BACK respectively, any Vector2(a,b) turns into a Vector3(a,0.0,b), and it's done.

Now the Building parts, that was a bit harder. Because I needed to translate the rotation functions. Goodbye my beloved rotation_degrees = value, you were so easy to use. I did find a suitable replacement with rotation = Vector3(0.0, deg_to_rad(value),0.0) but it took some times to find! I tried something with transform.basis.y = Vector3(coord pointing toward rotation wanted) but it had the small side effect of obliterating the object by putting its scale at (0,0,0) and thus generating a line of error per frame per object. Not. Ideal.

Then I had to redo my scene for the standard pipe. Which handles all the bends and forks of the pipes. I had to create a function to destroy all meshes, instantiate the new one and add it as child. Not that complex in itself, but much more than the sprite_2D = new_sprite that it was before.

It really is a lot more work, making a 3D game rather than a 2D one. Each action needs several lines of code to reproduce a simple instruction. But I quite like it! It's very satisfying when it works, and I love doing 3D! Next up will be the build mode, being able to place a Building on the grid with a click. That one is bound to take time because all my Vector work needs to be tested now! Fun times ahead! And after that... well, I could add the collision in the camera to bind it around the room, or I could find a way to handle the room's size to let the Grid decide whether a building can be placed or note. I could make all the other pipes and alembic in 3D to start incorporating them in the game. I could start to look into the shapes and the shape viewer...

I think it's time to dust off the old Codecks, sit down, and define the exact scope and steps for this version 0.2 of Fadunn!