When I heard about first JavaFX challenge, I decided to participate with some application that can show how powerful this language is. In order to do that, I created my own version of Rubik’s Cube game. Now, after upgrading it to JavaFX 1.2 version, I wish to share it with you.

I think there’s nothing to say about how the game works. Everybody knows that when cube faces are messy it’s really difficult to put them right, so that’s the target.
If the left bottom cube is selected, drag around the big cube allows watching it from different perspectives. Otherwise, if the selected is the right bottom one, it is allowed to rotate one “slice” of the cube.
Inside menu options, there is the scrambler function, besides other options. I’m not sure but I think that save/load options have been damaged when moving from JFX 1.0 to JFX 1.2, so probably they won’t work.
Taking into account that I’ve not used any kind of 3D engine, the complexity of the project is elevated, so I’m not going to detail how the game has exactly been developed. Anyway, for those who can be more interested, the key point is to extend from Polygon class for each one of the colored faces, in order to relate them with their 3D points, so the movement can be applied directly into the points. Maybe reading VideoCube example, in javafx webpage, can help understanding a little bit how all that works, because the concept is similar althought that example is smaller.
Enjoy it!
Click here to lauch JNLP
APPLET on kaikreations
Filed under: Uncategorized

Go to Source