ScratchData LogoScratchData
Back to oconnorjb's profile

Direction Towards Another Sprite demo

OCoconnorjb•Created November 19, 2013
Direction Towards Another Sprite demo
0
0
23 views
View on Scratch

Instructions

Click the green flag and then move the yellow lightning bolt or green dot around. The two variables in the upper right will show the direction FROM the yellow lightning bolt TOWARD the green dot, without making the yellow lightning bolt point in that direction.

Description

Two different methods are demonstrated here. Method 1 uses the blue lightning bolt as a "helper" sprite. It follows the yellow lightning bolt wherever it goes, and it always turns to point toward the green dot. Method 2 uses a script in the yellow lightning bolt that uses the trigonometric function "atan" to compute the direction toward the green dot.

Project Details

Project ID14459789
CreatedNovember 19, 2013
Last ModifiedNovember 19, 2013
SharedNovember 19, 2013
Visibilityvisible
CommentsAllowed