0 votes

So I have come up with a puzzle concept and read most of the Godot getting started documentation (am now up to the Best Practices section). Currently suffering from severe analysis paralysis on how to structure the project.

The puzzle is a variation on the old Rubik's magic cube concept and visually what I'm looking to do would best be described as having the colored stickers floating in a cube shape as if the cube itself were invisible and keeping there relative position as twists and turns are animated.

Mainly targeting touch devices, but will probably still hobble together some fashion of mouse interaction.

How do I :

  • Manage an aggregate object with complex motions like this in the scene/node hierarchy (pieces move relative to each other in different directions depending which sides are being twisted)?
  • Create and position the square meshes programmatically? - I have already modeled the individual pieces in Blender in order to do engraved markings but there are 54 of them so positioning at design time would be a pain considering I will probably want to tweak there spacing etc.
  • Should I be starting with a 3D scene or 2D scene and incorporating 3D using Viewport Sprite? - most likely just planning on a static solid background, and have no idea what I want for the user interface.
  • Stick with C# or learn GDScript - does either provide a performance advantage?

Any additional advice and road signs the already initiated could provide me with would be greatly appreciated.

asked Mar 21 in Projects by norlesh (19 points)

1 Answer

0 votes
Best answer

You could arrange a scene with six center nodes and 20 floating nodes, distribute your models into these nodes.
In the code before rotating a center node you need to check what nodes are aligned with it, assign them as children and then make the rotation.
To check if the cube is solved you can add your objects to six groups, and check for each group if every element is pointing to the same direction.

It can be done programmatically but if there is only one group of elements using the editor is easier.

2D/3D: use 3D scene.

C#/GDScript: There are some gains in performance with C#, but in the end use the language you are more comfortable with.

answered Mar 21 by davidoc (746 points)
selected Mar 24 by norlesh

Thanks for your feedback davidoc, could you expand a bit further please on what you mean by 'floating nodes' - where does the number 20 come from?

If you see a Rubik's cube it has 26 pieces, six in the centers and other 20 that move (I should have called it moving instead of floating)

thanks, that cleared it up.

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.