Update: CC - SnailRunner - Entity Loaded (78gnds8jrj.js) 414 bytes modified
parent
2e106ebee4
commit
89129bf704
|
@ -165,6 +165,26 @@ GameLib.CustomCode.prototype.adjustSpeed = function(delta) {
|
||||||
|
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
|
|
||||||
|
GameLib.CustomCode.prototype.adjustSnailPosition = function(diff) {
|
||||||
|
|
||||||
|
this.snail.position.z -= diff * 0.001 * this.speed;
|
||||||
|
|
||||||
|
if (this.snail.position.z < -4.8) {
|
||||||
|
this.snail.position.z = -4.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.snail.position.z > 4.8) {
|
||||||
|
this.snail.position.z = 4.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.solar.position.z = this.snail.position.z;
|
||||||
|
|
||||||
|
this.snail.updateInstance('position');
|
||||||
|
this.solar.updateInstance('position');
|
||||||
|
|
||||||
|
}.bind(this);
|
||||||
|
|
||||||
|
|
||||||
GameLib.Event.Subscribe(
|
GameLib.Event.Subscribe(
|
||||||
GameLib.Event.GAME_START,
|
GameLib.Event.GAME_START,
|
||||||
function() {
|
function() {
|
||||||
|
|
Loading…
Reference in New Issue