wgge 0.1.0 → 0.1.2

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 ADDED
@@ -0,0 +1,9 @@
1
+ # WEGGE
2
+
3
+ ## Publish
4
+
5
+ Change version in `package.json`.
6
+
7
+ Then run:
8
+
9
+ npm publish
@@ -30,12 +30,12 @@ export default class Rotation extends DirtyValue {
30
30
  return degs * Math.PI / 180;
31
31
  }
32
32
 
33
- set(value) {
34
- super.set(Rotation.normalizeValue(value));
33
+ set(rads) {
34
+ super.set(Rotation.normalizeValue(rads));
35
35
  }
36
36
 
37
- add(value) {
38
- return new Rotation(this.get() + value);
37
+ add(rads) {
38
+ return new Rotation(this.get() + rads);
39
39
  }
40
40
 
41
41
  subtract(value) {
@@ -50,8 +50,8 @@ export default class Rotation extends DirtyValue {
50
50
  return new Rotation(this.value);
51
51
  }
52
52
 
53
- setDegrees(value) {
54
- this.set(Rotation.degToRad(value));
53
+ setDegrees(degs) {
54
+ this.set(Rotation.degToRad(degs));
55
55
  }
56
56
 
57
57
  getDegrees() {
@@ -53,10 +53,16 @@ export default class GameController extends ControllerBase {
53
53
 
54
54
  }
55
55
 
56
+ activateInternal() {
57
+ super.activateInternal();
58
+ this.loadResourcesFromStorage();
59
+ }
60
+
56
61
  updateInternal(delta) {
57
62
 
58
63
  // saving of resources during debugging
59
64
  if (this.model.isInDebugMode.get()) {
65
+ if (this.model.resources.isDirty) this.isResourcesDirty = true;
60
66
  this.resourcesTimeOut = (this.resourcesTimeOut === null) ? 3000 : this.resourcesTimeOut - delta;
61
67
  if (this.isResourcesDirty && this.resourcesTimeOut <= 0) {
62
68
  this.resourcesTimeOut = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wgge",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Web GL Game Engine",
5
5
  "main": "index.js",
6
6
  "dependencies": {