arcanumcube 0.1.4 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -11
- package/dist/{cjs/arcanumcube.js → arcanumcube.cjs} +162 -1065
- package/dist/arcanumcube.cjs.map +1 -0
- package/dist/{esm/arcanumcube.module.js → arcanumcube.esm.js} +98 -952
- package/dist/arcanumcube.esm.js.map +1 -0
- package/dist/arcanumcube.umd.js +1851 -0
- package/dist/arcanumcube.umd.js.map +1 -0
- package/dist/demo.css +8 -0
- package/dist/demo.js +75 -0
- package/dist/index.html +14 -81
- package/dist/types/core.d.ts +1 -0
- package/dist/types/core.d.ts.map +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/materials.d.ts +1 -0
- package/dist/types/materials.d.ts.map +1 -0
- package/dist/types/skins.d.ts +1 -0
- package/dist/types/skins.d.ts.map +1 -0
- package/dist/types/webgl.d.ts +1 -0
- package/dist/types/webgl.d.ts.map +1 -0
- package/package.json +42 -38
- package/dist/cjs/core.js +0 -733
- package/dist/esm/arcanumcube.module.min.js +0 -19
- package/dist/esm/core.module.js +0 -686
- package/dist/esm/core.module.min.js +0 -4
- package/dist/types/arcanumcube.d.ts +0 -3
package/README.md
CHANGED
|
@@ -4,11 +4,11 @@ Arcanum Cube Arcanum Cube is a WebGL cube puzzle module written in TypeScript. Y
|
|
|
4
4
|
|
|
5
5
|
## Demo Page
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
|
|
7
|
+
- [Example1](https://mawxiwtz.github.io/arcanumcube/) \
|
|
8
|
+
Rotation only
|
|
9
9
|
|
|
10
|
-
-
|
|
11
|
-
|
|
10
|
+
- [Example2](https://mawxiwtz.github.io/arcanumcube-demo/) \
|
|
11
|
+
Demo of playing and solving with AI
|
|
12
12
|
|
|
13
13
|
## Installation
|
|
14
14
|
|
|
@@ -20,16 +20,22 @@ npm install arcanumcube
|
|
|
20
20
|
|
|
21
21
|
## Usage
|
|
22
22
|
|
|
23
|
-
1.
|
|
23
|
+
1. install dependencies
|
|
24
24
|
|
|
25
25
|
```
|
|
26
|
+
npm install arcanumcube
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
2. import Three.js and arcanumcube
|
|
30
|
+
|
|
31
|
+
```ts
|
|
26
32
|
import * as THREE from 'three';
|
|
27
33
|
import * as ARCCUBE from 'arcanumcube';
|
|
28
34
|
```
|
|
29
35
|
|
|
30
|
-
|
|
36
|
+
3. create a cube object
|
|
31
37
|
|
|
32
|
-
```
|
|
38
|
+
```ts
|
|
33
39
|
const scene = new THREE.Scene();
|
|
34
40
|
:
|
|
35
41
|
const arccube = new ARCCUBE.WebGLArcanumCube();
|
|
@@ -43,19 +49,19 @@ renderer.setAnimationLoop((time) => {
|
|
|
43
49
|
:
|
|
44
50
|
|
|
45
51
|
// animate twisting
|
|
46
|
-
arccube.
|
|
52
|
+
arccube.update();
|
|
47
53
|
|
|
48
54
|
renderer.render(scene, camera);
|
|
49
55
|
});
|
|
50
56
|
```
|
|
51
57
|
|
|
52
|
-
|
|
58
|
+
4. operations
|
|
53
59
|
|
|
54
|
-
```
|
|
60
|
+
```ts
|
|
55
61
|
// scramble 30 steps
|
|
56
62
|
arccube.scramble(30);
|
|
57
63
|
// twist 'U' direction
|
|
58
|
-
arccube.
|
|
64
|
+
arccube.easingTwist('U');
|
|
59
65
|
// reset
|
|
60
66
|
arccube.reset();
|
|
61
67
|
```
|