summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2013-08-07 18:00:23 +0200
committerjmoenig <jens@moenig.org>2013-08-07 18:00:23 +0200
commitb4db57dc94c5e59d0134ccfa8557cbd3dbdf912a (patch)
tree452b6914767d703ebc1d6fe6ff5aecd177d9ce91
parent325ad2297b3588bd3eb5444203da35579b6944de (diff)
downloadsnap-yow-b4db57dc94c5e59d0134ccfa8557cbd3dbdf912a.tar.gz
snap-yow-b4db57dc94c5e59d0134ccfa8557cbd3dbdf912a.zip
Nested Sprite Motion
-rwxr-xr-xhistory.txt1
-rw-r--r--objects.js8
2 files changed, 9 insertions, 0 deletions
diff --git a/history.txt b/history.txt
index 88ace3c..f76d5b7 100755
--- a/history.txt
+++ b/history.txt
@@ -1857,3 +1857,4 @@ ______
* Objects, GUI: Sprite Nesting preliminaries
* Objects: Fixed stage costume scaling & misplacing bug. Thanks, Josh, for the report!
* Objects, GUI: Sprite Nesting GUI
+* Objects: Nested Sprite Motion
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,