I am making an interactive buddy ragdall simulation thing and for the ragdall to bounce off of the mouse i need to find the slope my mouse is moving at but one of my scripts keeps turning red. post a fix if you can figure it out.
it looks like this
(when flag clicked)
forever{
wait[0.000001]seconds
set [mouse direction] to [ (mouse YTotal)-(Mouse XTotal)
}
That is the block that keeps screwing up. The mouse direction is pretty self explanetory. the Mouse YTotal and Mouse XTotal are the differences of two Mouse Xs and Two Mouse Ys taken about .00000001 seconds after each other. The full equation goes like this goes like this if I were to write it out Y2 - Y1 That is the algebraic
_______
X2 - X1
equation for slope. Please tell me what i did wrong
Last edited by Willdawg (2008-12-28 19:19:46)
Offline
The slope? No, you need the angle instead.
Try looking at this project http://scratch.mit.edu/projects/archmage/147654
Offline