Latest posts on Dunehttps://scratch.mit.edu/discuss/topic/291184/2018-02-09T00:35:14+00:00Making Scratch Projects :: Help With Scripts :: Dune
2018-02-09T00:35:14+00:00gtar12986570<blockquote><p class="bb-quote-author">NormallyNormal wrote:</p>This might help you understand derivatives a bit more: <a href="https://www.desmos.com/calculator/byotbuhlmf">https://www.desmos.com/calculator/byotbuhlmf</a><br/>Basically, imagine you were a car driving along the curve. If you flew off the curve, the orange line is the direction you would fly off in.</blockquote>Is it possible for you to show me how to make a derivative too?
Making Scratch Projects :: Help With Scripts :: Dune
2018-02-09T00:29:27+00:00gtar12986563<blockquote><p class="bb-quote-author">NormallyNormal wrote:</p>This might help you understand derivatives a bit more: <a href="https://www.desmos.com/calculator/byotbuhlmf">https://www.desmos.com/calculator/byotbuhlmf</a><br/>Basically, imagine you were a car driving along the curve. If you flew off the curve, the orange line is the direction you would fly off in.</blockquote>thxs
Making Scratch Projects :: Help With Scripts :: Dune
2018-02-09T00:23:34+00:00NormallyNormal2986556This might help you understand derivatives a bit more: <a href="https://www.desmos.com/calculator/byotbuhlmf">https://www.desmos.com/calculator/byotbuhlmf</a><br/>Basically, imagine you were a car driving along the curve. If you flew off the curve, the orange line is the direction you would fly off in.
Making Scratch Projects :: Help With Scripts :: Dune
2018-02-09T00:14:38+00:00gtar12986546<blockquote><p class="bb-quote-author">NormallyNormal wrote:</p>You would do something like this below, and replace the numbers like 1.1 and 0.52 in the render dunes block with your own that you decided on. It might look a little different in scratch (stretched out, compressed, etc.) so that's why you should test it. You can use the code from this if you want but I'm not sure how optimized it is. The change x by (number) controls how fast the scrolling is.<br/><a href="https://scratch.mit.edu/projects/203019554/">https://scratch.mit.edu/projects/203019554/</a><br/><br/>Edit: Also make sure to change the numbers to the same thing in the player sprite.</blockquote>Thanks! That helps a lot!
Making Scratch Projects :: Help With Scripts :: Dune
2018-02-09T00:08:50+00:00NormallyNormal2986543You would do something like this below, and replace the numbers like 1.1 and 0.52 in the render dunes block with your own that you decided on. It might look a little different in scratch (stretched out, compressed, etc.) so that's why you should test it. You can use the code from this if you want but I'm not sure how optimized it is. The change x by (number) controls how fast the scrolling is.<br/><a href="https://scratch.mit.edu/projects/203019554/">https://scratch.mit.edu/projects/203019554/</a><br/><br/>Edit: Also make sure to change the numbers to the same thing in the player sprite.
Making Scratch Projects :: Help With Scripts :: Dune
2018-02-08T23:30:09+00:00gtar12986500<blockquote><p class="bb-quote-author">NormallyNormal wrote:</p>I know what game you are talking about<br/><br/>You haven't specified anything that you need to know but I can give you a few ideas.<br/><br/>The dunes could be comprised of sine/cosine waves being multiplied together. (the same kind of principle I used in this project: <a href="https://scratch.mit.edu/projects/200464164/">https://scratch.mit.edu/projects/200464164/</a> )<br/><br/>As for getting the ball to accelerate WITH the waves/dunes, I think the most efficient method would be to take the derivative of the dune equation to get the slope, then make a script that will use that to calculate the upwards velocity.<br/><br/>If you don't know derivatives that's fine. I'll get to that in the next paragraph.<br/>For making the dune equation, go on the online graphing calculator called desmos and copy this into the equation box:<br/>\cos\left(2.1x\right)\cdot\sin\left(3x\right)\cdot\cos\left(5x\right)\cdot\sin\left(6.2x\right)<br/>then adjust the numbers until you get something you like.<br/><br/>Once you've got the equation you want (make sure to test it in scratch) use symbolab (online math solver) and paste this in:<br/>\frac{d}{dx}\left(\cos \left(2.1x\right)\cdot \sin \left(3x\right)\cdot \cos \left(5x\right)\cdot \sin \left(6.2x\right)\right)<br/>with your numbers instead of mine (edit them once it is pasted in). This will give you the derivative, which when you plug in an X, the result will be the slope of the equation at that X. You can use the slope to determine how fast upwards the player should go. It will probably be a pretty long equation so make sure when you translate it to scratch you don't make any mistakes.<br/><br/>This is fairly complex math so if you need further clarification, ask. </blockquote>Also, how do I test it in scratch?
Making Scratch Projects :: Help With Scripts :: Dune
2018-02-08T23:08:29+00:00gtar12986480<blockquote><p class="bb-quote-author">NormallyNormal wrote:</p>I know what game you are talking about<br/><br/>You haven't specified anything that you need to know but I can give you a few ideas.<br/><br/>The dunes could be comprised of sine/cosine waves being multiplied together. (the same kind of principle I used in this project: <a href="https://scratch.mit.edu/projects/200464164/">https://scratch.mit.edu/projects/200464164/</a> )<br/><br/>As for getting the ball to accelerate WITH the waves/dunes, I think the most efficient method would be to take the derivative of the dune equation to get the slope, then make a script that will use that to calculate the upwards velocity.<br/><br/>If you don't know derivatives that's fine. I'll get to that in the next paragraph.<br/>For making the dune equation, go on the online graphing calculator called desmos and copy this into the equation box:<br/>\cos\left(2.1x\right)\cdot\sin\left(3x\right)\cdot\cos\left(5x\right)\cdot\sin\left(6.2x\right)<br/>then adjust the numbers until you get something you like.<br/><br/>Once you've got the equation you want (make sure to test it in scratch) use symbolab (online math solver) and paste this in:<br/>\frac{d}{dx}\left(\cos \left(2.1x\right)\cdot \sin \left(3x\right)\cdot \cos \left(5x\right)\cdot \sin \left(6.2x\right)\right)<br/>with your numbers instead of mine (edit them once it is pasted in). This will give you the derivative, which when you plug in an X, the result will be the slope of the equation at that X. You can use the slope to determine how fast upwards the player should go. It will probably be a pretty long equation so make sure when you translate it to scratch you don't make any mistakes.<br/><br/>This is fairly complex math so if you need further clarification, ask. </blockquote>One thing: For the first step, what should i do with the var x, and should I do something like<pre class="blocks">pen down<br/>set x to (the formula)</pre>
Making Scratch Projects :: Help With Scripts :: Dune
2018-02-08T23:02:13+00:00gtar12986472<blockquote><p class="bb-quote-author">NormallyNormal wrote:</p>I know what game you are talking about<br/><br/>You haven't specified anything that you need to know but I can give you a few ideas.<br/><br/>The dunes could be comprised of sine/cosine waves being multiplied together. (the same kind of principle I used in this project: <a href="https://scratch.mit.edu/projects/200464164/">https://scratch.mit.edu/projects/200464164/</a> )<br/><br/>As for getting the ball to accelerate WITH the waves/dunes, I think the most efficient method would be to take the derivative of the dune equation to get the slope, then make a script that will use that to calculate the upwards velocity.<br/><br/>If you don't know derivatives that's fine. I'll get to that in the next paragraph.<br/>For making the dune equation, go on the online graphing calculator called desmos and copy this into the equation box:<br/>\cos\left(2.1x\right)\cdot\sin\left(3x\right)\cdot\cos\left(5x\right)\cdot\sin\left(6.2x\right)<br/>then adjust the numbers until you get something you like.<br/><br/>Once you've got the equation you want (make sure to test it in scratch) use symbolab (online math solver) and paste this in:<br/>\frac{d}{dx}\left(\cos \left(2.1x\right)\cdot \sin \left(3x\right)\cdot \cos \left(5x\right)\cdot \sin \left(6.2x\right)\right)<br/>with your numbers instead of mine (edit them once it is pasted in). This will give you the derivative, which when you plug in an X, the result will be the slope of the equation at that X. You can use the slope to determine how fast upwards the player should go. It will probably be a pretty long equation so make sure when you translate it to scratch you don't make any mistakes.<br/><br/>This is fairly complex math so if you need further clarification, ask. </blockquote>HOLY COW! This was EXACTLY what I was looking for! THANKS SO MUCH!! <img src="//cdn.scratch.mit.edu/scratchr2/static/__628c3a81fae8e782363c36921a30b614__/djangobb_forum/img/smilies/big_smile.png" />
Making Scratch Projects :: Help With Scripts :: Dune
2018-02-07T04:28:24+00:00NormallyNormal2984668I know what game you are talking about<br/><br/>You haven't specified anything that you need to know but I can give you a few ideas.<br/><br/>The dunes could be comprised of sine/cosine waves being multiplied together. (the same kind of principle I used in this project: <a href="https://scratch.mit.edu/projects/200464164/">https://scratch.mit.edu/projects/200464164/</a> )<br/><br/>As for getting the ball to accelerate WITH the waves/dunes, I think the most efficient method would be to take the derivative of the dune equation to get the slope, then make a script that will use that to calculate the upwards velocity.<br/><br/>If you don't know derivatives that's fine. I'll get to that in the next paragraph.<br/>For making the dune equation, go on the online graphing calculator called desmos and copy this into the equation box:<br/>\cos\left(2.1x\right)\cdot\sin\left(3x\right)\cdot\cos\left(5x\right)\cdot\sin\left(6.2x\right)<br/>then adjust the numbers until you get something you like.<br/><br/>Once you've got the equation you want (make sure to test it in scratch) use symbolab (online math solver) and paste this in:<br/>\frac{d}{dx}\left(\cos \left(2.1x\right)\cdot \sin \left(3x\right)\cdot \cos \left(5x\right)\cdot \sin \left(6.2x\right)\right)<br/>with your numbers instead of mine (edit them once it is pasted in). This will give you the derivative, which when you plug in an X, the result will be the slope of the equation at that X. You can use the slope to determine how fast upwards the player should go. It will probably be a pretty long equation so make sure when you translate it to scratch you don't make any mistakes.<br/><br/>This is fairly complex math so if you need further clarification, ask.
Making Scratch Projects :: Help With Scripts :: Dune
2018-02-07T03:30:38+00:00gtar12984653I want to re-create the game Dune, if you've heard of it. It involves a ball, and when you hold, the ball comes down from it's jump faster, and if you land on a bump perfectly, you get more speed.