Intro To Java Workshop
Section 1 (Alternate)
Introduction to Programming
Do the frosted cookie activity to introduce the idea that computers will only do exactly what we tell them to.
Introduction to Robot coding
Do the Robot Race activity to get students practicing writing code.
Robot Coding
Have students complete RobotFreestyle.java in eclipse (package zebra.section1).
Rocket
Rocket.pde in processing (package zebra.section1).
- Introduce students to
circle(x, y, r);
(make connection between calling this method and callingmove()
andturn()
). If using an older version of processing, useellipse()
instead ofcircle()
- Ask students to experiment with changing the parameters and running the code to figure out what each of the parameters controls
- Explain x/y coordinates
- Ask students to complete step 1 in Rocket.pde to add stars/moon in the sky
- Ask students to identify where the circles in the rocket are being drawn--they should see the variables
rocketX
androcketY
in the coordinates - Briefly explain variables
- Give students the code to make the rocket move (
rocketY = rocketY - 1;
) to complete step 2 - Give them time to experiment to make the rocket move faster or move sideways