From 4fee0752e48e201a45ab375c8b2b825c2ad91f06 Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Thu, 23 Nov 2017 09:43:40 +0100 Subject: [PATCH] Initial Commit: CC - Moorcow Start Scene, rotate ball (ds7xhwnsao.js) --- ds7xhwnsao.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 ds7xhwnsao.js diff --git a/ds7xhwnsao.js b/ds7xhwnsao.js new file mode 100644 index 0000000..a82835e --- /dev/null +++ b/ds7xhwnsao.js @@ -0,0 +1,38 @@ +this.topBall = GameLib.EntityManager.Instance.findComponentById('gh1x1h7rot'); +this.bottomBall = GameLib.EntityManager.Instance.findComponentById('796eyo44j8'); + + +this.text0 = GameLib.EntityManager.Instance.findComponentById('hzr8jx7485'); +this.text1 = GameLib.EntityManager.Instance.findComponentById('rlx2sebygk'); + +if (!this.initialized) { + this.initialized = true; + this.time = 0; +} + +this.time += data.delta; + +if (this.text1) { + this.text0.scale.x = 0.08 + Math.sin(2 * this.time) * 0.01; + this.text0.scale.y = 0.08 + Math.sin(2 * this.time) * 0.01; + this.text0.scale.z = 0.08 + Math.sin(2 * this.time) * 0.01; + this.text0.updateInstance('scale'); + + this.text1.scale.x = 0.09 + Math.cos(2 * this.time) * 0.01; + this.text1.scale.y = 0.09 + Math.cos(2 * this.time) * 0.01; + this.text1.scale.z = 0.09 + Math.cos(2 * this.time) * 0.01; + this.text1.updateInstance('scale'); +} + +if (this.topBall) { + + this.topBall.rotation.y = Math.sin(this.time); + this.topBall.updateInstance('rotation'); +} + +if (this.bottomBall) { + this.bottomBall.rotation.y = Math.cos(this.time); + this.bottomBall.updateInstance('rotation'); +} + +//@ sourceURL=CustomCode (ds7xhwnsao).js \ No newline at end of file