This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2008-12-28 19:17:15

Willdawg
Scratcher
Registered: 2008-11-28
Posts: 8

Problem with Interactive Buddy Scratch Version

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

 

#2 2008-12-28 20:46:07

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Problem with Interactive Buddy Scratch Version

The slope? No, you need the angle instead.

Try looking at this project http://scratch.mit.edu/projects/archmage/147654


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#3 2008-12-29 11:37:37

Willdawg
Scratcher
Registered: 2008-11-28
Posts: 8

Re: Problem with Interactive Buddy Scratch Version

Thanks I realized I was making this way too hard.  Do you mind if I use your Interactive buddy sprites?

Offline

 

Board footer