Wiki » History » Revision 38
Revision 37 (Leszek Koltunski, 09/25/2020 09:29 AM) → Revision 38/61 (Leszek Koltunski, 09/25/2020 09:30 AM)
h1. Overview
Magic Cube is an application which lets one play with Cubes and Pyraminxes of any (reasonable!) size. It contains graphics effects provided by the "Distorted":https://distorted.org/redmine/projects/distorted-android/wiki/wiki library.
Users can submit their best times to a central High Scores list and download results made by others.
Additionally there's a near-perfect, instantenous 3x3x3 Cube Solver (Kociemba) and a about 2000 Pretty Patterns (more in the plans!).
Magic Cube is open source and released under the terms of the "GNU General Public License v2":http://www.gnu.org/licenses/old-licenses/gpl-2.0.html (GPL).
h1. Downloads
Google play : https://play.google.com/store/apps/details?id=org.distorted.magic
Amazon App Store: https://www.amazon.co.uk/Developer-Magic-Cube/dp/B0875PSWTK
h1. Source code
<pre>
git clone http://distorted.org/git/distorted-library.git
git clone http://distorted.org/git/distorted-cube.git
</pre>
h1. Tutorials
h2. How to add a new Object
* Write a new class which extends "TwistyObject":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/objects/TwistyObject.java
* Write a new class which extends "Movement":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/objects/Movement.java
* add your new classes to the "ObjectList":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/objects/ObjectList.java enum (here you will also need to provide a small icon to add to the "play" drop-down object list)
and your new Object will automatically become available in the "Play" drop-down list.
Currently implemented Objects: a "Cube":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/objects/TwistyCube.java , a "Pyraminx":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/objects/ObjectPyraminx.java , a "6-color Dino":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/objects/ObjectDiino6.java , a "4-color Dino":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/objects/ObjectDino4.java , a "Skewb":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/objects/ObjectSkewb.java , and a "Helicopter":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/objects/ObjectHelicopter.java
,
h2. How to add a new Transition Effect
If you would like to add, say, a new WIN effect (i.e. animation which happens when the Object gets solved) all you need to do is add a new class which extends "org.distorted.effect.WinEffect":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/effects/win/WinEffect.java and add the new class to the "org.distorted.effect.WinEffect.Type":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/effects/win/WinEffect.java enum.
The new effect will automatically become available in the "Effects dialog":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/dialogs/RubikDialogEffects.java.
h2. How to add a new Pretty Pattern
If you've got a collection of Pretty Patterns for a given (already implemented!) RubikObject, say a Pyraminx 3x3x3, all you need to do to connect it to the Magic Cube is to create a table of Strings describing the patterns ( format needs to follow the one already done in "Cube Patterns":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/patterns/RubikPatternCube3.java ) and add the new pattern list to the "org.distorted.patterns.RubikPatternList":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/patterns/RubikPatternList.java enum.
The new list of Patterns will automatically become available in the "Patterns dialog":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/dialogs/RubikDialogPattern.java.
h2. How to add a new Solver
Work in the "org.distorted.solvers":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/show/src/main/java/org/distorted/solvers package. First create a subdirectory containing the code of your actual solver, then connect it to the rest of the program by modifying the "org.distorted.solvers.SolverMain":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/solvers/SolverMain.java class, and finally add the new solver to the "org.distorted.solvers.ImplementedSolversList":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/solvers/ImplementedSolversList.java enum.
Currently implemented solvers: "a near-perfect, instantenous Cube3 solver":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/show/src/main/java/org/distorted/solvers/cube3.
Magic Cube is an application which lets one play with Cubes and Pyraminxes of any (reasonable!) size. It contains graphics effects provided by the "Distorted":https://distorted.org/redmine/projects/distorted-android/wiki/wiki library.
Users can submit their best times to a central High Scores list and download results made by others.
Additionally there's a near-perfect, instantenous 3x3x3 Cube Solver (Kociemba) and a about 2000 Pretty Patterns (more in the plans!).
Magic Cube is open source and released under the terms of the "GNU General Public License v2":http://www.gnu.org/licenses/old-licenses/gpl-2.0.html (GPL).
h1. Downloads
Google play : https://play.google.com/store/apps/details?id=org.distorted.magic
Amazon App Store: https://www.amazon.co.uk/Developer-Magic-Cube/dp/B0875PSWTK
h1. Source code
<pre>
git clone http://distorted.org/git/distorted-library.git
git clone http://distorted.org/git/distorted-cube.git
</pre>
h1. Tutorials
h2. How to add a new Object
* Write a new class which extends "TwistyObject":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/objects/TwistyObject.java
* Write a new class which extends "Movement":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/objects/Movement.java
* add your new classes to the "ObjectList":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/objects/ObjectList.java enum (here you will also need to provide a small icon to add to the "play" drop-down object list)
and your new Object will automatically become available in the "Play" drop-down list.
Currently implemented Objects: a "Cube":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/objects/TwistyCube.java , a "Pyraminx":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/objects/ObjectPyraminx.java , a "6-color Dino":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/objects/ObjectDiino6.java , a "4-color Dino":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/objects/ObjectDino4.java , a "Skewb":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/objects/ObjectSkewb.java , and a "Helicopter":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/objects/ObjectHelicopter.java
,
h2. How to add a new Transition Effect
If you would like to add, say, a new WIN effect (i.e. animation which happens when the Object gets solved) all you need to do is add a new class which extends "org.distorted.effect.WinEffect":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/effects/win/WinEffect.java and add the new class to the "org.distorted.effect.WinEffect.Type":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/effects/win/WinEffect.java enum.
The new effect will automatically become available in the "Effects dialog":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/dialogs/RubikDialogEffects.java.
h2. How to add a new Pretty Pattern
If you've got a collection of Pretty Patterns for a given (already implemented!) RubikObject, say a Pyraminx 3x3x3, all you need to do to connect it to the Magic Cube is to create a table of Strings describing the patterns ( format needs to follow the one already done in "Cube Patterns":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/patterns/RubikPatternCube3.java ) and add the new pattern list to the "org.distorted.patterns.RubikPatternList":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/patterns/RubikPatternList.java enum.
The new list of Patterns will automatically become available in the "Patterns dialog":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/dialogs/RubikDialogPattern.java.
h2. How to add a new Solver
Work in the "org.distorted.solvers":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/show/src/main/java/org/distorted/solvers package. First create a subdirectory containing the code of your actual solver, then connect it to the rest of the program by modifying the "org.distorted.solvers.SolverMain":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/solvers/SolverMain.java class, and finally add the new solver to the "org.distorted.solvers.ImplementedSolversList":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/entry/src/main/java/org/distorted/solvers/ImplementedSolversList.java enum.
Currently implemented solvers: "a near-perfect, instantenous Cube3 solver":https://distorted.org/redmine/projects/magic-cube/repository/magiccube/revisions/master/show/src/main/java/org/distorted/solvers/cube3.