@urso/core 0.7.5 → 0.7.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@urso/core",
3
- "version": "0.7.5",
3
+ "version": "0.7.6",
4
4
  "description": "HTML5 game engine",
5
5
  "main": "build/js/index.js",
6
6
  "author": "Megbrimef",
package/src/js/app.js CHANGED
@@ -6,6 +6,9 @@ class App {
6
6
  this.setup = this.setup.bind(this);
7
7
  }
8
8
 
9
+ /**
10
+ * global init
11
+ */
9
12
  setup() {
10
13
  this.sayHello();
11
14
 
@@ -32,6 +35,7 @@ class App {
32
35
 
33
36
  //Extra
34
37
  Urso.browserEvents = Urso.getInstance('Extra.BrowserEvents');
38
+ this._addTimeouts();
35
39
 
36
40
  //libs
37
41
  Urso.cache = Urso.getInstance('Lib.Cache'); //all assets cache
@@ -67,13 +71,32 @@ class App {
67
71
  });
68
72
  }
69
73
 
74
+ /**
75
+ * log engine name and its version
76
+ */
70
77
  sayHello() {
71
78
  console.log(`%c ${String.fromCodePoint(0x1F43B)} Urso ${this.version} `, 'background: #222; color: #bada55');
72
79
  }
73
80
 
81
+ /**
82
+ * run default scene
83
+ */
74
84
  run() {
75
85
  Urso.scenes.display(Urso.config.defaultScene);
76
86
  }
87
+
88
+ /**
89
+ * add Urso.setTimeout && Urso.clearTimeout functions. It will helps to manage time
90
+ */
91
+ _addTimeouts() {
92
+ Urso.setTimeout = (callback, delay) => {
93
+ return gsap.delayedCall(delay / 1000, callback);
94
+ }
95
+
96
+ Urso.clearTimeout = (tween) => {
97
+ tween.kill();
98
+ }
99
+ }
77
100
  }
78
101
 
79
102
  module.exports = App;
@@ -14,7 +14,6 @@ require("pixi-text-input");
14
14
 
15
15
  import { gsap } from 'gsap';
16
16
  window.gsap = gsap;
17
- require('./setTimeout');
18
17
 
19
18
  import Howler from 'howler';
20
19
  window.Howler = Howler;
@@ -1,7 +0,0 @@
1
- Urso.setTimeout = (callback, delay) => {
2
- return gsap.delayedCall(delay / 1000, callback);
3
- }
4
-
5
- Urso.clearTimeout = (tween) => {
6
- tween.kill();
7
- }