This week lecture was looking more at
coding aspect, and show us one technique for identify your concept class which
is class responsibility and collaboration cards. Each card presents an
individual class and include its responsibilities and its collaborators.
Pacman
Responsibilities:
Move-up
Move-down
Move-left
Move-right
Eat Pac-dots
Pac-dot
Wall
In Class Card
|
Pac-dot
Responsibilities:
Eaten by Pacman
Pacman
In Class Card
|
Wall
Responsibilities:
Detect Pacman
Hit by Pacman
Pacman
In Class Card
|
Score
Responsibilities:
Detect Pac-dots
Add score
Pacman
Pac-dots
In Class Card
|
This week's progress:
I create a new function that can destroy objects,so it's allow me to make the Pac-dots disappear when Pacman touch them. i attach this script to the Pac-man object, so Pacman can eat Pac-dots now.


没有评论:
发表评论