100 likes | 188 Views
Greenfoot B4. Rest Day #1. The Tour De France. Even professional cyclists need a couple of rest d ays But they aren’t really rest days and they will be: Going on training rides Seeing their Masseurs and Physios Eating lots Watching reviews of stages past . Driving future stages.
E N D
Greenfoot B4 Rest Day #1
The Tour De France • Even professional cyclists need a couple of rest days • But they aren’t really rest days and they will be: • Going on training rides • Seeing their Masseurs and Physios • Eating lots • Watching reviews of stages past. • Driving future stages
Today’s Objectives • Complete ALL the objectives so far. • Understand the theory from previous lessons: • Classes • Objects • Methods • Ifs • Random Numbers • Using images we like we will have created a theme that we are happy with.
Classes Definition Creating a new class Right click on Actor and select SubClass Give it a name starting with capital letter • A Class is a type of something. • It is a template used to create new object of that class. • Example: • we are all humans. • we belong to the class called humans. • All objects or things with in a class will share similar: • Characteristics or Properties. • Behaviors or Methods.
Objects Objects Creating objects. Right click and select new Frog() or whatever the name of your class is. Now you can position on the stage Or Select an Actor Class Hold shift and click somewhere on the stage. Don’t forget Right click on the stage and select Save the World to remember the objects you’ve added and their positions. • An object is an instance of a class. • Example • You are an instance of Human • Therefore you are an object of type human. • You could also be an object of type student or an instance of the student class • Sounds a bit odd, but you’ll get use to it.
Homework • Make a blog post titled 5 rules of good programming. • Make sure you include techniques such as: • Using comments to explain code in plain english; • Using sensible names for objects and variables that explains what they are; • Describe modular programming that uses methods to break down problems into easy to solve ones. • Make sure you explain why good programming is important – what could go wrong! • Due – unless your teacher says otherwise its due NEXT LESSON!