object oriented design. goals pacman project reflections the sims project: additional pointers
Post on 21-Dec-2015
230 views
TRANSCRIPT
On state diagrams Naming of states: much better! Transitions
Need labels! Labels = Event [Guard] / Action If multiple objects are involved: event needs to
describe who is involved what happens to whom Describe Event not Method attacking
fleeing
eat
Not clear who is involved
Ghost states:
Ghost state diagram
attacking
fleeingfleeing blinking
Returning to ghost home
Pacman eats power pill
Power Pill effect fades away (10 secs)
Power Pill effect is gone (2 secs)
Pacman eats ghost
Pac
man
eat
s gh
ost
Ghost reaches home
Sequence diagrams Keep general flow left to right
What makes the ghost go right?:Pacman :Ghost
kill
:Ghost :Pacman
kill
Ok, but not recommended
Good
Collaborative Diffusion Search
Can be used to build simulations including object interactions even more complex than that found in the Sims
Diffusion Difference Equations
Simple (k=0.25) u := 0.25 * (u[left] + u[right] + u[up] + u[down])
General u := @k * (u[left] + u[right] + u[up] + u[down] - 4 * u) + u Where k is
The diffusion coefficient Should be < 0.45