Version 9 ---------- There is a world with multiple randomly-placed, randomly-sized, stationary particles. There are buttons to play, step, and reset the model. Stepping the model causes the particles to move. If the particles hits a wall, it bounces off. Resetting the model places the particles at a new random location with a new random size. Playing the model causes it to step repeatedly. Resetting the model causes it to stop playing. Once the play button has been clicked, it cannot be clicked again until the model is reset. 1. Version 8 ---------- There is a world with 1 randomly-placed, randomly-sized, stationary particle. There are buttons to play, step, and reset the model. Stepping the model causes the particle to move. If the particle hits a wall, it bounces off. Resetting the model places the particle at a new random location with a new random size. Playing the model causes it to step repeatedly. Resetting the model causes it to stop playing. Once the play button has been clicked, it cannot be clicked again until the model is reset. 1. Add an "if" statement to the step function that checks if the particle has gone past a wall, and if it has, reverses the direction of the particle 2. Anywhere there is code for center_x and velocity, add code for center_y and velocity_y Version 7 ---------- There is a world with 1 randomly-placed, randomly-sized, stationary particle. There are buttons to play, step, and reset the model. Stepping the model causes the particle to move. Resetting the model places the particle at a new random location with a new random size. Playing the model causes it to step repeatedly. Resetting the model causes it to stop playing. Once the play button has been clicked, it cannot be clicked again until the model is reset. 1. In the reset function, call clearInterval 2. In the play function, add a line to gray out (disable) the play button 3. In the reset function, add a line to enable the play button Version 6 ---------- There is a world with 1 randomly-placed, randomly-sized, stationary particle. There are buttons to play, step, and reset the model. Stepping the model causes the particle to move. Resetting the model places the particle at a new random location with a new random size. Playing the model causes it to step repeatedly. 1. Add an HTML button element for the Play button 2. Define a Javascript function that is called whenever the button is clicked a. The function will call the step function repeatedly using setInterval Version 5 ---------- There is a world with 1 randomly-placed, randomly-sized, stationary particle. There are buttons to step and reset the model. Stepping the model causes the particle to move. Resetting the model places the particle at a new random location with a new random size. 1. Add an HTML button element for the reset button 2. Define a Javascript function that is called whenever the button is clicked a. The function will do what the on-load already does b. Clear the canvas 3. Add an HTML button element for the step button 4. Define a Javascript function that is called whenever the button is clicked a. Change the x-postion of the particle by 1 Version 4 ---------- There is a world with 1 randomly-placed, randomly-sized, stationary particle. 1. Get random numbers for center_x, center_y, and radius 2. Make sure the circle is inside the walls Version 3 ---------- There is a world with 1 stationary particle. 1. Make the canvas bigger 2. Create a Javascript file 3. Link it to the HTML file 4. Add Javascript code to draw a circle on the canvas Version 2 ---------- 1. Create an HTML canvas element 2. Style it using CSS give it a border and background Version 1 ---------- 1. Add the name 2. Add a description Version 0 ---------- 1. Download the template 2. Upload the template to our public_html 3. Open the template in our web browser