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

#1 2008-08-10 08:08:14

cds56
Scratcher
Registered: 2008-05-02
Posts: 500+

Interestingly enough, Bows and arrow help(again) realistic gravity

I guess im an ok scratcher, I even have my own rudimentary program on visual BASIC 2003 code but I cant figure out how to make an arrow not follow the mouse on a bow and arrow game!
 
  now i have three games that came close (only one is on the internet) but the arrows in these gostraight and follow th mouse like a heat seeking missile...if i just gave up and used the variable slider controls well that wouldnt be fun enough for me, so could someone help.... smile


http://img192.imageshack.us/img192/909/meowdevlogo.pnghttp://i32.tinypic.com/pucti.png

Offline

 

#2 2008-08-10 08:14:50

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Interestingly enough, Bows and arrow help(again) realistic gravity

when i recieve [shoot arrow]
repeat until <touching [what it's supposed to be touching]>
     point towards [mouse-pointer]
     move (5) steps

you can modify it to fit your needs. You might want to make a variable that changes depending on if it's supposed to be moving or not.

Offline

 

#3 2008-08-10 11:29:41

bigB
Scratcher
Registered: 2007-06-09
Posts: 100+

Re: Interestingly enough, Bows and arrow help(again) realistic gravity

firstly to try to make a ball fly realistically.
try this
point in direction (direction of bow)
set power to 10
set gravity to 0
repeat until touching edge.
move power steps
change y by gravity
set power to (power times 0.98)
change gravity by -0.1

to make it into an arrow devise a script that makes a seperate arrow sprite point twords and move towards the ball.


http://scratch.mit.edu/projects/bigB/260981 Draw to Text
http://scratch.mit.edu/projects/bigB/181829 3D Stunt Flyer

Offline

 

Board footer