/** * It's a thing! */ var creature = { dna: {}, cellInstances: [], start: function() { }, initCells() { for(var i = 0; i < this.dna.length; i++) { var newCell = GameObject.create(cell, this.transform.position.x + (this.dna[i].pos.x * 32), this.transform.position.y + (this.dna[i].pos.y * 32), s_orb, 500); newCell.setType(this.dna[i].type); newCell.parentCreature = this; newCell.localPos = new vector(this.dna[i].pos.x * 32, this.dna[i].pos.y * 32) this.cellInstances.push(newCell); } }, update: function(deltaTime) { this.transform.rotation += deltaTime * 60; this.transform.position = this.transform.position.add(this.transform.forward().stretch(deltaTime * 250)) }, onDestroy: function() { }, onCollision: function(other) { } }