Skip to content

allala0/rubiks-cube.js

Repository files navigation

Rubiks Cube

Rubiks cube of any size in browser.

                         

Introduction

Rubiks cube made in three.js

How to install

git clone https://github.com/allala0/rubiks-cube.js.git
cd rubiks-cube.js
npm install

How to build

npm run build

How to run examples

npm run example

OR

npm run example-module

How to use

import RubiksCube from './build/RubiksCube.module.js';

const size = 3;
const cube = new RubiksCube(size);
scene.add(cube);

OR FOR INTERACTIVE CUBE

import RubiksCube from './build/RubiksCube.module.js';

const size = 3;
const cube = new RubiksCube(sizes, camera, renderer.domElement);
scene.add(cube);

OR FOR INTERACTIVE CUBE WHEN YOU USE ORBIT CONTROLS

import RubiksCube from './build/RubiksCube.module.js';

const size = 3;
const cube = new RubiksCube(sizes, camera, renderer.domElement, controls);
scene.add(cube);

TODO

  • 3d rubiks cube of any size
  • Cube user control system
  • Scramble function
  • Unscramble function
  • **Optimalisation: don't create cubies that are not visable (inside cube)**q
  • Bug fixes - connect tiles with cubie faces in term of mouse click detection
  • Rounded edges of cubie stickers and cubies
  • Cube move take always same amount of time
  • Code cleanup and rewrite
  • Cube rotations function
  • AI solver
  • Functions to make patterns on cube for example: checkers, cube in cube
  • Moves containing many layers at the same time in scramble
  • Reverse one move function
  • Support for phone user controls
  • Timer
  • Solve stats (time, number of moves, replay)
  • Mirror cube
  • Pyraminx
  • Skweb
  • Megaminx
  • Square-1
  • 3x3x2, 3x3x1, 2x2x1
  • 3x3x1
  • 2x2x1

License

MIT License

Copyright (c) 2022 Artur Brytkowski

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

About

Rubiks cube in browser

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published