1. Lecture #4
Ahmed Safwat
Muhamad Hesham
Abdelrahman Al-Ogail
2. What about Singleton?
Call for a new requirement.
First try implementation.
Meet today’s pattern.
Second try implementation.
Common uses.
Project Description.
What’s after all of this?
11. I want the enemy turn
crazy when you collect a
gem.
If you touch the enemy
while it is crazy, you die
and it turns idle again.
Double crazy enemy
speed by 4 times once.
12. reach cliff
after a while
Running Idle
gem
gem collected
collected
player died
Crazy
22. Pattern’s Challenge Try it yourself
Strategy/State conflict
Challenge:
What are the differences between State and
Strategy Pattern?
23. What’s Next Further Reading
State Pattern: Chapter 10 in Head First
Strategy Pattern: Chapter 1 in Head First
GoF: Behavioral Pattern Section
Section: enhance way of drawing shapes