Scratch Sprites - Which Functions?
If we are going to focus on the following six pieces of information, we need to have operators that both modify and give us access to this data.
- Name - as a string
- xLocation - as an integer (assumed to be -240 to +240)
- yLocation - as an integer (assumed to be -180 to +180)
- size - as an integer (assumed to be 0 to 100)
- Direction - as an integer (assumed to be -180 to +180)
- Show - as a Boolean
When I sat down and looked at this there were some obvious functions that needed inclusion. Mainly, MOST of the blue blocks under the Move menu. But there also are some that aren't directly provided as Scratch blocks that probably are part of an overall OO design.
Class Diagram
The way we represent these decisions in the Class Diagram is to revise it to look like this: