How to do the Counter

Description

GCSE Computer Science (Greenfoot) Slide Set on How to do the Counter, created by Leann McLeod on 03/05/2016.
Leann McLeod
Slide Set by Leann McLeod, updated more than 1 year ago
Leann McLeod
Created by Leann McLeod almost 8 years ago
21
0

Resource summary

Slide 1

    How to code for the Counter
    World Actor
    We are going to use the example of the a ship and Iceberg in the Ocean world.

Slide 2

    Code for the World (At the top)
    Caption: : This blue box is adding the counter to the world. Therefore with this reference, the world can link with the actor and the counter. BEWARE NO BRACKETS

Slide 3

Slide 4

Slide 5

    Version 2 - Different GREENFOOT
    This Greenfoot is for the Newer version.

Slide 6

    Caption: : This is a key concept when programming Greenfoot. This is that the various Actors and the World - using references - can communicate or talk to each other. They cannot communicate without references.
    Key Concept

Slide 7

    IN THE WORLD
    Caption: : This is to go in the prepare section in the World. This is adding the Counter object - manually - into the world. This can be done automatically by dragging the counter where you want it and pressing "Save the World".

Slide 8

    IN THE WORLD (contd.)
    Caption: : If you could please pay attention to the purple box. The reason the word "counter" is placed in the brackets for when the Turtle is being created is that when that is done, a reference for the counter to the turtle is being created. Now the turtle will know and recognize the counter, therefore it can tell the counter to update a score if needed, when the parameter is updated on to its own class area for coding and programming.

Slide 9

    IN THE ACTOR
    Caption: : This makes the final reference to the Counter. The blue box is focusing on the code while the pink box is focusing on the position of the code. It is before the "act" function.

Slide 10

Show full summary Hide full summary

Similar

Computing Hardware - CPU and Memory
ollietablet123
SFDC App Builder 2
Parker Webb-Mitchell
Data Types
Jacob Sedore
Intake7 BIM L1
Stanley Chia
Software Processes
Nurul Aiman Abdu
Design Patterns
Erica Solum
CCNA Answers – CCNA Exam
Abdul Demir
Abstraction
Shannon Anderson-Rush
Spyware
Sam2
HTTPS explained with Carrier Pigeons
Shannon Anderson-Rush
Data Analytics
anelvr