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

#1 2012-08-28 17:05:35

wolfdude999
Scratcher
Registered: 2012-01-07
Posts: 1000+

Parabolic Projectile

How would I be able to make a projectile shoot out of something pointing towards the mouse pointer with the path being parabolic?


http://i48.tinypic.com/15yxmp4.png

Offline

 

#2 2012-08-28 17:28:22

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Parabolic Projectile

when gf clicked
set [power v] to [some number]
forever
go to [starting place v]
repeat until <mouse down?>
point towards [mouse-pointer v]
end
set [x-vel v] to ((power)*([sin v] of (direction)))
set [y-vel v] to ((power)*([cos v] of (direction)))
repeat until <<touching [ground v]?> or <touching [edge v]?>>
change x by (x-vel)
change y by (y-vel)
change [y-vel v] by (-0.2) // gravity

Last edited by MoreGamesNow (2012-08-28 17:28:37)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#3 2012-08-28 17:29:17

Molybdenum
Scratcher
Registered: 2012-06-17
Posts: 1000+

Re: Parabolic Projectile

Here's an example I made for berberberber:
http://scratch.mit.edu/projects/Molybdenum/2622042

EDIT: Outposted.

Last edited by Molybdenum (2012-08-28 17:29:33)


"The Enrichment Center is required to remind you that you will be baked, and then there will be cake."
(|Balls and Platforms: Stay on!|) (|NaOS-H: An operating system... Or is it?|)

Offline

 

#4 2012-08-28 17:33:24

wolfdude999
Scratcher
Registered: 2012-01-07
Posts: 1000+

Re: Parabolic Projectile

Thanks!


http://i48.tinypic.com/15yxmp4.png

Offline

 

Board footer