mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-06-15 06:51:50 -04:00
Merge pull request #1748 from joker314/feat/point-random
Implement "point towards random direction"
This commit is contained in:
commit
0a68722b80
1 changed files with 3 additions and 0 deletions
|
@ -123,6 +123,9 @@ class Scratch3MotionBlocks {
|
|||
if (args.TOWARDS === '_mouse_') {
|
||||
targetX = util.ioQuery('mouse', 'getScratchX');
|
||||
targetY = util.ioQuery('mouse', 'getScratchY');
|
||||
} else if (args.TOWARDS === '_random_') {
|
||||
util.target.setDirection(Math.round(Math.random() * 360) - 180);
|
||||
return;
|
||||
} else {
|
||||
const pointTarget = this.runtime.getSpriteTargetByName(args.TOWARDS);
|
||||
if (!pointTarget) return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue