How can we make this rube goldberg to work?
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
I just made these three changes:
- 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.
- In your step function, I changed ff to raise(ff, dt), telling the simulation that raising the flag is part of what it does.
- 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!