You use this program ??? {forever turn [sin of direction /20]} I found this program 3 days ago. If you use sin bomb will turn down, if cos will turn to the right.
There are many ways to make a cannon ball simulation look pretty good...the method I'm using here is actually a pretty accurate method that will show the motion that actually happens in real life...a parabola :)
You use this program ??? {forever turn [sin of direction /20]}
I found this program 3 days ago. If you use sin bomb will turn down, if cos will turn to the right.
paddle2see, im making a cannon game and i was wondering how to make the sprite point in the dirrection its moving? i tried [point in direction(atan of (xvel/yvel))] which works fine...until the direction gets to the negatives. Then it flips out and points all over the place! I asked you because i know your a math wiz
In most computer languages, there is a nice function that would do that for you, called ATAN2. You give it both the numerator and the denominator as separate arguments and it gives you the correct angle. Scratch doesn't have ATAN2 - but you can write it yourself.
In below cannon shutting game multiple balls can be in the air at a time and they bounce of from a very scary Queen Ant that is trying to sting you...
(link to project)
in the barrel tip sprite i didn't know how to get the one block that said barrel length of barrel. i dont know how to make new things in that sensing block. could u tell me?
nice project:)
That use trig? Lots! This one uses trig to position the cannonball and set the initial velocity. There are easier ways to do the positioning but getting the initial velocity components is still a useful thing to know how to do. Let me know what you are looking for and I probably have a demo somewhere.
Hey... I am too working on a similar design with the acclaimed 'official' formulae from Wikipedia (http://upload.wikimedia.org/math/9/3/9/939be4f0fab1698937920cf1208e0044.png)! :p However I am having trouble with this formula which is very hard tot understand... :/ Could you possible take a look and see where you think I've gone wrong? :/ The project's here (link to project) Thanks!
i can help you make a cannon with scrolling, in fact i am making a cannon game as i type. the reason its more complicated though, (but not difficult, i am a scratch professional) is because its a birds-eye view cannon
Scrolling. Hmmm. I'm not really good at scrollers. Is the background scrolling behind a stationary gun...or a stationary cannonball? Or both at different times? It can get kind of complicated...
This is awesome! :D I like the way that the ball stamps its path - you can compare different paths. Good work! Another thing - I downloaded the project, and saw how people had to deal without the comment block... *laughs*.
Absolutely. It's a bit overly complex, looking back on it. Archmage did a nice version of this called Trig-less Cannon which you might want to check out :)
Hello again. I ran into a problem while working on my tanks game. Since you seem to be an expert with scratch+math, I thought you could help. Here's a link to my latest version of the tanks game ((link to project) Read the description on that page also. As you will see, when the missile hits the edge, it stops and then just falls to the ground. I've added scrolling capabilities to the scenery, but I'm really not sure how to make the sceneryscrollasthemissilemoves.
Hello again. I ran into a problem while working on my tanks game. Since you seem to be an expert with scratch+math, I thought you could help. Here's a link to my latest version of the tanks game ((link to project) Read the description on that page also. As you will see, when the missile hits the edge, it stops and then just falls to the ground. I've added scrolling capabilities to the scenery, but I'm really not sure how to make the sceneryscrollasthemissilemoves.
Hey, I recently uploaded my scratch project and I used some of your trigonometry scripts because I would have never been able to figure it out. I'm making this scratch project for my computer class, and I need your permission to use your scripts. Please reply soon, and nice trigonometry skills!
You can use any of my projects for anything you like, as long as you give credit. Actually, that's true of all the projects on Scratch - it's in the Terms of Use :)
Hi. I like the idea of this game. How do I make the angle smaller and how do I control the trajectory if I want to draw some holes in the ground for the player to drop the ball into a specific hole. What I really mean is for a person who is not so adept can I give them a choice of three trajectories as each hole appears for them to shoot. Not sure if I am asking right. Thanks.
Make a target sprite and set up a loop that moves it to one of the three spots. You have to decide if it should just wait a certain amount of time before switching or if it should switch after every shot fired. Finally, set up scoring on the target to keep track of whether it was hit by the ball.
Once you have the barrel angle being set properly, it's time to think about setting up a target that appears at one of three spots randomly. The spots need to be where the ball hits the ground when set to the angles...I would shoot the ball to find those spots.
Start by taking out the pieces that you don't need...find where the arrow keys control the cannon and break those scripts. Then, pick the three angles you want to use and set up keys or buttons to allow the user to select them. The value you want to set is the Barrel direction...so set up your controls to set the barrel angle to the desired values.
There should be one on the front page by Klasbrick which is dual language. And, of course, many of ffred's projects are dual language. Great idea for a gallery, by the way!
Sorry, I have not made any calculus projects as such...there are a number of projects I have made that use integration to calculate some variables though...such as Good Vibrations.
There always seems to be interest in things that shoot. Here's how to do it with the new Trig functions.
Use Space to shoot, Up/Down to control the barrel angle, Right/Left to roll the cannon around. The X key can be used to clear the cannonball paths.
This is a cannon with the projectile motion calculated using the new Trig functioons. The tip of the Barrel is also located using the Trig functions so that the Ball can be placed at the Barrel tip when it is fired.
Wind is accounted for as a constant change to horizontal velocity. This is not a very realistic model, but it looks good enough for animation.
In addition to changing the barrel angle and the wind, the trajectory can be further modified by changing the inital velocity or the acceleration due to gravity (Ay) in the scripts.
Comments
You need to be logged in to post comments
Add a Comment
Lol i got the cart on fire :))
XD!!
cool i can make an angry birds with this
Sure, if you want. However, you might find this project even better for your purposes (link to project)
You use this program ??? {forever turn [sin of direction /20]} I found this program 3 days ago. If you use sin bomb will turn down, if cos will turn to the right.
There are many ways to make a cannon ball simulation look pretty good...the method I'm using here is actually a pretty accurate method that will show the motion that actually happens in real life...a parabola :)
You use this program ??? {forever turn [sin of direction /20]} I found this program 3 days ago. If you use sin bomb will turn down, if cos will turn to the right.
Fabulous programming! Great example!
zomg i set myself on fire! lol
If you fire, push the up key once, fire, and keep going until you fire backwards, you get a nice looking object :3
Nice! So what are you doing messing around with this old antique :) ?
(view all replies)if you hold x and space at the same time, only one ball is fired.
LOL ッ
ッ
WOW that is EPIC!
have you ever set your self on fire?,its hilarious.
Probably not a good idea...
I owned my cannon truck. :3
paddle2see, im making a cannon game and i was wondering how to make the sprite point in the dirrection its moving? i tried [point in direction(atan of (xvel/yvel))] which works fine...until the direction gets to the negatives. Then it flips out and points all over the place! I asked you because i know your a math wiz
Be sure to read the project notes though - it talks about how you might use it for velocity :)
(view all replies)Take a look at this project - I think it does what you want (link to project)
(view all replies)In most computer languages, there is a nice function that would do that for you, called ATAN2. You give it both the numerator and the denominator as separate arguments and it gives you the correct angle. Scratch doesn't have ATAN2 - but you can write it yourself.
In below cannon shutting game multiple balls can be in the air at a time and they bounce of from a very scary Queen Ant that is trying to sting you... (link to project)
nvm.
You shouldn't spam.
I hit myself!YAHOOO!Anyway I found out it always goes east...Or it trys to.
to make a game out of this point the turret upwards shoot and evade try not to let it hit u and set wind to 0
Good idea!
Not bad! Anyhow, can I request you a favor?
You can always ask - but I make no promises :)
(view all replies)Cool!
This is a great project for teaching my class about simulations. Thanks. :)
You are most welcome!
Can I use this for a game? Of course, I will give you credit.)
Sure! Have fun with it :)
in the barrel tip sprite i didn't know how to get the one block that said barrel length of barrel. i dont know how to make new things in that sensing block. could u tell me? nice project:)
never mind figured it out
(view all replies)watt is the point in this game ?xxxx
No point. It's just showing one way to make a shooting cannon, if you need one for your project :)
Have you made any other trig games like this?
That use trig? Lots! This one uses trig to position the cannonball and set the initial velocity. There are easier ways to do the positioning but getting the initial velocity components is still a useful thing to know how to do. Let me know what you are looking for and I probably have a demo somewhere.
(view all replies)How old are you now in 2011?
Middle aged :)
(view all replies)paddle i was making a cannon game but i needed a cannon. this project helped me alot.(dont wory ill give you credit for it.
Glad you found it useful!
may i make a game with this?
Yes you may...just as you can with any project shared on the Scratch site :)
ya i know about the glitch were it dies if you miss can you fix it for me
check it out now i improved the remix
check out my games iv only got 3 + a remix of this
Hey... I am too working on a similar design with the acclaimed 'official' formulae from Wikipedia (http://upload.wikimedia.org/math/9/3/9/939be4f0fab1698937920cf1208e0044.png)! :p However I am having trouble with this formula which is very hard tot understand... :/ Could you possible take a look and see where you think I've gone wrong? :/ The project's here (link to project) Thanks!
BTW I'm Bulbo... :P I just didn't want to upload this to my official account! ;)(Though I'm sure you had already guessed that! :P)
kinda odd but still really well scripted good job!
heh heh. now you burn up!
awesome, i caught the cannon on fire :)
me 2
(view all replies)check mine out (link to project)
Hey paddle2see , i'm making a game with these scripts , can i use the scripts?
i can help you make a cannon with scrolling, in fact i am making a cannon game as i type. the reason its more complicated though, (but not difficult, i am a scratch professional) is because its a birds-eye view cannon
Scrolling. Hmmm. I'm not really good at scrollers. Is the background scrolling behind a stationary gun...or a stationary cannonball? Or both at different times? It can get kind of complicated...
Sure! You use anyone's scripts on Scratch :)
(view all replies)this is great but you should make a game out of this.
Maybe...or *you* could :)
This is awesome! :D I like the way that the ball stamps its path - you can compare different paths. Good work! Another thing - I downloaded the project, and saw how people had to deal without the comment block... *laughs*.
I should redo this...it really is overly complicated. Oh well - glad you enjoyed it anyway.
Oops I shot myself...
What goes up....must come down :)
(view all replies)Oops I shot myself...
Shoot at approx. 45 degrees right at wind -10, KABOOM!
Ah, the dreaded "boomerang effect" - lol!
With a screen shot at the end one could work backwards and figure out what the angle was to begin with and create a quadratic equation.
Yes, I suppose you could :)
Wow, and you can destroy yourself! XD
Always be careful when firing guns :)
(view all replies)awesome!
Thanks...I keep meaning to redo this and make it simpler. But it hasn't happened yet :)
i can use this if i give credit, right? thx
Absolutely. It's a bit overly complex, looking back on it. Archmage did a nice version of this called Trig-less Cannon which you might want to check out :)
(view all replies)Hello again. I ran into a problem while working on my tanks game. Since you seem to be an expert with scratch+math, I thought you could help. Here's a link to my latest version of the tanks game ((link to project) Read the description on that page also. As you will see, when the missile hits the edge, it stops and then just falls to the ground. I've added scrolling capabilities to the scenery, but I'm really not sure how to make the sceneryscrollasthemissilemoves.
Hello again. I ran into a problem while working on my tanks game. Since you seem to be an expert with scratch+math, I thought you could help. Here's a link to my latest version of the tanks game ((link to project) Read the description on that page also. As you will see, when the missile hits the edge, it stops and then just falls to the ground. I've added scrolling capabilities to the scenery, but I'm really not sure how to make the sceneryscrollasthemissilemoves.
I made a scroller with projectiles that move with respect to the background that you might want to download (link to project)
(view all replies)Hey, I recently uploaded my scratch project and I used some of your trigonometry scripts because I would have never been able to figure it out. I'm making this scratch project for my computer class, and I need your permission to use your scripts. Please reply soon, and nice trigonometry skills!
You can use any of my projects for anything you like, as long as you give credit. Actually, that's true of all the projects on Scratch - it's in the Terms of Use :)
(view all replies)Also, here's the link to the game I made (link to project)
Hi. I like the idea of this game. How do I make the angle smaller and how do I control the trajectory if I want to draw some holes in the ground for the player to drop the ball into a specific hole. What I really mean is for a person who is not so adept can I give them a choice of three trajectories as each hole appears for them to shoot. Not sure if I am asking right. Thanks.
Make a target sprite and set up a loop that moves it to one of the three spots. You have to decide if it should just wait a certain amount of time before switching or if it should switch after every shot fired. Finally, set up scoring on the target to keep track of whether it was hit by the ball.
Once you have the barrel angle being set properly, it's time to think about setting up a target that appears at one of three spots randomly. The spots need to be where the ball hits the ground when set to the angles...I would shoot the ball to find those spots.
Start by taking out the pieces that you don't need...find where the arrow keys control the cannon and break those scripts. Then, pick the three angles you want to use and set up keys or buttons to allow the user to select them. The value you want to set is the Barrel direction...so set up your controls to set the barrel angle to the desired values.
(view all replies)Sir, do you know any projects which contain more than one language? I am looking for projects for my new gallery: Multiple-Language Projects.
There should be one on the front page by Klasbrick which is dual language. And, of course, many of ffred's projects are dual language. Great idea for a gallery, by the way!
(view all replies)Sir, have you made any calculus projects? I am looking for projects for my gallery "Museum of Calculus"
Sorry, I have not made any calculus projects as such...there are a number of projects I have made that use integration to calculate some variables though...such as Good Vibrations.
(view all replies)I made a remix of this: (link to project)
i'm looking for pinball ,can you help me
Sure...try this (link to project)
thanks alot
cool
I love so much this game.
lol blow up the truck
You can make some really cool designs with this.
good ! if you plan anything else in geometry and physics area, just tell us