Need help with an assignment from school

Good project. Start with a blank sketch and add things to it in small steps.

To get a blank sketch going, you will need to know about the setup() and draw() functions. You will need a call to background() in one, and size() in the other.

Next, make the background green. Which function controls the background color?

Next, realize that you are going to need to keep track of a few things. Specifically, you will need to remember the position of the player. This means you will need a couple of float variables.

Can you draw a player rectangle at the player’s position? Use rect() and fill()!

Now where is the coin? More variables! How does the coin’s location get set? Use random()!

Try putting something together now - ANYTHING - and post the code of your attempt for more help. Tell us what works. Tell us what doesn’t. Tell us what you have tried. Tell us what you expected to happen. Show us your code.

2 Likes