From b4db57dc94c5e59d0134ccfa8557cbd3dbdf912a Mon Sep 17 00:00:00 2001 From: jmoenig Date: Wed, 7 Aug 2013 18:00:23 +0200 Subject: Nested Sprite Motion --- objects.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'objects.js') diff --git a/objects.js b/objects.js index 095f644..e1f054d 100644 --- a/objects.js +++ b/objects.js @@ -2624,6 +2624,14 @@ SpriteMorph.prototype.drawLine = function (start, dest) { // SpriteMorph motion +SpriteMorph.prototype.moveBy = function (delta) { + // override the inherited default to make sure my parts follow + SpriteMorph.uber.moveBy.call(this, delta); + this.parts.forEach(function (part) { + part.moveBy(delta); + }); +}; + SpriteMorph.prototype.forward = function (steps) { var start = this.rotationCenter(), dest, -- cgit v1.3.1