From 28e0f88c7e9adbf1c888493d424c2a1ddaf1921f Mon Sep 17 00:00:00 2001 From: Simon-Mong <30740101+Simon-Mong@users.noreply.github.com> Date: Wed, 8 Sep 2021 19:19:10 +0800 Subject: [PATCH] defination of reportRandomPosition block defination of reportRandomPosition block --- stitchcode/threads.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/stitchcode/threads.js b/stitchcode/threads.js index 0505c5ea..bd4b6f97 100644 --- a/stitchcode/threads.js +++ b/stitchcode/threads.js @@ -84,3 +84,15 @@ Process.prototype.doGotoObject = function (name) { this.origDoGotoObject(name); } }; + +Process.prototype.reportRandomPosition = function () { + var thisObj = this.blockReceiver(), + stage; + + if (thisObj) { + stage = thisObj.parentThatIsA(StageMorph); + return new List([this.reportBasicRandom(stage.reportX(stage.left()), stage.reportX(stage.right())), + this.reportBasicRandom(stage.reportY(stage.top()), stage.reportY(stage.bottom()))]); + } + +};