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

#1 2010-06-12 15:51:53

TheGameMaster1231
Scratcher
Registered: 2009-07-24
Posts: 1000+

I Need Help With My Next Project...

I'm Making A Project, And I Need Help With Something. On The Menu, Theres A Small Square Robot. Its Supposed To:

1. Follow The Mouse. (DONE. Thanks Sep!)
2. Spin Around. (DONE. Thanks Sep!)
3. Not Be Able To Go Through Walls. (DONE. Thanks Sep!)
4. A Script That Measures How Fast The Mouse Is Moving. (Must Store Information Into A Variable.) (DONE. Thanks ScratchReallyRocks!)
Can Somebody Give Me The Scripts I Would Use? Thanks.  smile

EDIT: I Decided To Make This A 1s1s. I Crammed All My Scripts Together And Have A Huge One Now. Prepare For One Of The Best 1s1s Projects Ever!

Last edited by TheGameMaster1231 (2010-06-13 08:31:03)

Offline

 

#2 2010-06-12 16:05:51

SeptimusHeap
Scratcher
Registered: 2010-02-01
Posts: 1000+

Re: I Need Help With My Next Project...

when green flag clicked
forever
set last x to x position
set last y to y position
if mouse x < x postition
change x position by -1
else
if mouse x > x position
change x position by 1
if mouse y < y postition
change y position by -1
else
if mouse y > y position
change y position by 1
turn < 15 degrees
if touching color [wall color]
go to x: last x y: last y


http://i46.tinypic.com/dw7zft.png

Offline

 

#3 2010-06-12 19:06:49

TheGameMaster1231
Scratcher
Registered: 2009-07-24
Posts: 1000+

Re: I Need Help With My Next Project...

SeptimusHeap wrote:

when green flag clicked
forever
set last x to x position
set last y to y position
if mouse x < x postition
change x position by -1
else
if mouse x > x position
change x position by 1
if mouse y < y postition
change y position by -1
else
if mouse y > y position
change y position by 1
turn < 15 degrees
if touching color [wall color]
go to x: last x y: last y

Thanks, But I Was Thinking More Like A Gravitational Movement. (Sorta Like The Friction Marble...)  smile


EDIT: Nevermind. I Used Both Your Script And The Friction Marble's Script And I Got It To Work!  smile

Last edited by TheGameMaster1231 (2010-06-12 19:50:33)

Offline

 

#4 2010-06-12 19:53:14

TheGameMaster1231
Scratcher
Registered: 2009-07-24
Posts: 1000+

Re: I Need Help With My Next Project...

Ok, I Need Something Else Now: I Need A Script That Measures How Fast The Mouse Is Moving. (It Needs To Store The Information Into A Variable.)

If Anyone Can Make This Scrpit, Then Please Tell Me!  smile

Offline

 

#5 2010-06-12 20:27:48

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: I Need Help With My Next Project...

TheGameMaster1231 wrote:

Ok, I Need Something Else Now: I Need A Script That Measures How Fast The Mouse Is Moving. (It Needs To Store The Information Into A Variable.)

If Anyone Can Make This Scrpit, Then Please Tell Me!  smile

What do you want to measure it in? Because I bet I can do it...

Last edited by ScratchReallyROCKS (2010-06-12 20:28:08)


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#6 2010-06-12 20:49:06

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: I Need Help With My Next Project...

ScratchReallyROCKS wrote:

TheGameMaster1231 wrote:

Ok, I Need Something Else Now: I Need A Script That Measures How Fast The Mouse Is Moving. (It Needs To Store The Information Into A Variable.)

If Anyone Can Make This Scrpit, Then Please Tell Me!  smile

What do you want to measure it in? Because I bet I can do it...

I did it. It measures in pps (pixels per second) here it is. Un unfortunately the variable shows up in the wrong place online. Oh well, it works  big_smile


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

Board footer