Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Great arc scipt
- X-15
-
Scratcher
51 posts
Great arc scipt
One of my first difficulty when I first started scratch was getting a proper arc script and I experimented with many unsuccessful attempts. Recently I have noticed lot of good projects that struggle with a basic arc script or the physics are a bit off. I will show you a simple and effective way to do it. You can use this script without permission, but a link to this page would be nice. You can customize this script to suit your projects needs like using arrow keys to control force ect…
if you also want it to have proper rotation (for example an arrow) add this script in the loop.
when I receive [shoot]
set [force] to <distance to [mouse pointer]>
set [Xspeed] to (([sin] of (direction)) * (force))
set [Yspeed] to (([cos] of (direction)) * (force))
repeat until <<touching [ wall] ?> or <touching [ object] >>
change [Yspeed] by (-1)
change x by (Xspeed)
change y by (Yspeed)
end
if you also want it to have proper rotation (for example an arrow) add this script in the loop.
point in direction ([atan] of ((Xspeed) / (Yspeed)))Here is a project I made to demonstrate Bow physics , Hope it helps!
if <[Yspeed] < [0]> then
turn cw (180) degrees
end
- Dogtor
-
Scratcher
12 posts
Great arc scipt
Oh, well that helps! I tried making an arrow script and even with a gigantic amount of power, it just fell! Thanks!
- SuperFunnyStuff
-
Scratcher
2 posts
Great arc scipt
Thanks! I will use this in my upcoming project, Cannonball! I'll make sure to give credit to you, of course! 

- Capsulateflyer8
-
Scratcher
9 posts
Great arc scipt
thanks alot!
define (thank you)
set [ THANKS ALOT] to [1000022425845 ]
- SuperFunnyStuff
-
Scratcher
2 posts
Great arc scipt
when [people helping mev] > (999)
say [OMGOMGOMMGM!!!!!1!!!!!!!!!1 THX!]
- Alice74Love
-
Scratcher
2 posts
Great arc scipt
Cool!when I receive [shoot]
set [force] to <distance to [mouse pointer v]>
set [Xspeed] to (([sin v] of (direction)) * (force))
set [Yspeed] to (([cos v] of (direction)) * (force))
repeat until <<touching [ wall v] ?> or <touching [ object v] >>
change [Yspeed] by (-1)
change x by (Xspeed)
change y by (Yspeed)
end
if you also want it to have proper rotation (for example an arrow) add this script in the loop.point in direction ([atan] of ((Xspeed) / (Yspeed)))Here is a project I made to demonstrate Bow physics , Hope it helps!
if <[Yspeed] < [0]> then
turn cw (180) degrees
end
- LangfordH01
-
Scratcher
3 posts
Great arc scipt
(me) say [you awesome!! thanks so much!!!] for (83857345874395734584759857923485) years
- Capsulateflyer8
-
Scratcher
9 posts
Great arc scipt
say [Beat that LangfordH01] for (479165846598356713571) millenniums
- Mr_Twenty_7
-
Scratcher
2 posts
Great arc scipt
I've been trying to figure out a good arc script, thank you so much! I'm going to be studying this script and the math behind it.
- teaparty05
-
Scratcher
2 posts
Great arc scipt
when green flag clicked
forever
if <key [left arrow] pressed?> then
change x by (-10)
end
if <key [ right arrow] pressed?> then
change x by (10)
end
end
forever
play sound [xylo2]
end
- Allie016
-
Scratcher
7 posts
Great arc scipt
I've been trying to do an arching game, for like, forever. This is so helpful! Thank you







- Capsulateflyer8
-
Scratcher
9 posts
Great arc scipt
when green flag clicked
set [ THNX] to [320714305443979561085614751459 ]
- Discussion Forums
- » Help with Scripts
-
» Great arc scipt

