How can we make this rube goldberg to work?


196
views
0
10 weeks ago by

Hey Chris, can you help me with this program and fix it, so it can do what we want it to do.

I assume that you know whats supposed to happen because we talked about it last week.  If not here's what its supposed to do: once ball2 goes down in a hill kind of way to the right, ball will come right after it (the blue one) falling down in a hill kind of way as well to the left, then the flag will be raised up until the end of the gray pole.

Here is the link:  https://code.world/#PTbsiJgdX3S7j-84v0QT9ng

add commentfollow this post modified 10 weeks ago by Chris Smith   • written 10 weeks ago by Alyssa Ann Dilan  

1 Answer


2
10 weeks ago by

In this: https://code.world/#Peb8NfjUBQ9udVsYvRnRW6Q

I just made these three changes:

  1. I finished the raise function that you started.  To raise a flag, if it's not all the way up, it goes up at its current velocity.  If it is already up, it doesn't change.  To write a function that says that, I used guards.
  2. In your step function, I changed ff to raise(ff, dt), telling the simulation that raising the flag is part of what it does.
  3. In initialFlagF, I set the initial y velocity to 0, so that the flag starts out still, and only starts moving when triggered starts it.

And that's all you need!

add comment written 10 weeks ago by Chris Smith  

Thank You!!!!!

written 10 weeks ago by Alyssa Ann Dilan  
Please log in to add an answer/comment or follow this question.

Share this question


Similar posts:
Search »