SlideShare a Scribd company logo
1 of 17
Download to read offline
An Introducton to Game
Programming with Flash
2. Object Oriented Programming
What is O-O?
Researching problem from a perspectve of:
● Objects
● Dependencies
● Relatons
What can be O-O?
● Analysis
● Design
● Programming
Why O-O?
Easier:
● Analysis
● Design
● Programming and maintenance
Why is it so important?
package foo
{
public class Person
{
private var name:String;
public function Person(name:String)
{
this.name = name;
}
public function introduce():String
{
return "My name is " + name;
}
}
}
1
2
3
4
5
Class
import foo.Person;
var person:Person = new Person("John Smith");
person.introduce(); //My name is John Smith
1
2
Object
package foo
{
public class Rapper extends Person
{
public function Rapper(name:String)
{
super(name);
}
}
}
import foo.Rapper;
var snoopDog:Rapper = new Rapper("Snoop Dogg");
snoopDog.introduce(); //My name is Snoop Dogg
1
2
3
Inheritance
package foo
{
public class Rapper extends Person
{
public function Rapper(name:String)
{
super(name);
}
override public function introduce():String
{
return "YO! " + super.introduce();
}
}
}
import foo.Rapper;
var snoopDog:Rapper = new Rapper("Snoop Dogg");
snoopDog.introduce(); //YO! My name is Snoop Dogg
2
3
Polymorphism
1
Enakpsulaton
Hiding implementaton and exposing only desired API
Access modifiers:
● public – for everyone
● protected – only for the same class or subclasses
● internal – only for the same package
● private – only the same class
Interface
package foo
{
public interface IPerson
{
function introduce():String;
}
}
1
2
Statc fields and methods
package foo
{
public class Math
{
public static const PI:Number = 3.14;
public static function abs(value:Number):Number
{
return (value >= 0) ? value : -value;
}
}
}
Math.PI; //3.14
Math.abs(-5); //5
1
2
3
Good practces
● Single Responsibility Principle
● Open/Closed Principle
● Liskov Substtuton Principle
● Interface Segregaton Principle
● Dependency Inversion Principle
● ...
● Don't Repeat Yourself
● Law of Demeter
● ...
● COMMON SENCE!
Jet&Giant
git clone git://github.com/krzysztof-o/epi-
wdpg.git
Jet&Giant
Task 1
Moving a Giant:
● Giant can move horizontally and vertcally
● smoothing
Task 2
Enemies:
● Two classes should inherit from Enemy
● Enemy_1 moves quickly, along straight line
● Enemy_1 need single hit to be destroyed
● Enemy_2 moves slowly, along sine wave
● Enemy_2 needs double hit to be destroyed
enemy_1 enemy_2
Task 3
Giant – Enemy collision:
● Collision causes showing boom animaton
● Collision takes one Giant's life
Task 4
Shootng enemies:
● Enemies can shoot with random frequency
● Hitting Giant with bullet takes one life

More Related Content

What's hot

Dive into Pinkoi 2013
Dive into Pinkoi 2013Dive into Pinkoi 2013
Dive into Pinkoi 2013Mosky Liu
 
Collaborative Software Development
Collaborative Software DevelopmentCollaborative Software Development
Collaborative Software DevelopmentAlexander Serebrenik
 
[Question Paper] Network Security (Revised Syllabus) [October / 2012]
[Question Paper] Network Security (Revised Syllabus) [October / 2012][Question Paper] Network Security (Revised Syllabus) [October / 2012]
[Question Paper] Network Security (Revised Syllabus) [October / 2012]Mumbai B.Sc.IT Study
 

What's hot (6)

Dive into Pinkoi 2013
Dive into Pinkoi 2013Dive into Pinkoi 2013
Dive into Pinkoi 2013
 
Cryptography
CryptographyCryptography
Cryptography
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Collaborative Software Development
Collaborative Software DevelopmentCollaborative Software Development
Collaborative Software Development
 
DLR MCQs
DLR MCQsDLR MCQs
DLR MCQs
 
[Question Paper] Network Security (Revised Syllabus) [October / 2012]
[Question Paper] Network Security (Revised Syllabus) [October / 2012][Question Paper] Network Security (Revised Syllabus) [October / 2012]
[Question Paper] Network Security (Revised Syllabus) [October / 2012]
 

Viewers also liked

The history of Flash
The history of FlashThe history of Flash
The history of FlashMaso Lin
 
АКТУАЛЬНО СОЦИО-ЭКОНОМИЧЕСКОЕ ПОЛОЖЕНИЕ ТРАНСГЕНДЕРНЫХ И КВИР ЛЮДЕЙ НА ПОСТСО...
АКТУАЛЬНО СОЦИО-ЭКОНОМИЧЕСКОЕ ПОЛОЖЕНИЕ ТРАНСГЕНДЕРНЫХ И КВИР ЛЮДЕЙ НА ПОСТСО...АКТУАЛЬНО СОЦИО-ЭКОНОМИЧЕСКОЕ ПОЛОЖЕНИЕ ТРАНСГЕНДЕРНЫХ И КВИР ЛЮДЕЙ НА ПОСТСО...
АКТУАЛЬНО СОЦИО-ЭКОНОМИЧЕСКОЕ ПОЛОЖЕНИЕ ТРАНСГЕНДЕРНЫХ И КВИР ЛЮДЕЙ НА ПОСТСО...Tangarr Forgart
 
Learning flash by Ms. Payal Narula
Learning flash by Ms. Payal Narula Learning flash by Ms. Payal Narula
Learning flash by Ms. Payal Narula kulachihansraj
 
Intro to Flash 8 welcome & course outline (2008)
Intro to Flash 8 welcome & course outline (2008)Intro to Flash 8 welcome & course outline (2008)
Intro to Flash 8 welcome & course outline (2008)Matteo Wyllyamz
 

Viewers also liked (6)

Flash8
Flash8Flash8
Flash8
 
The history of Flash
The history of FlashThe history of Flash
The history of Flash
 
АКТУАЛЬНО СОЦИО-ЭКОНОМИЧЕСКОЕ ПОЛОЖЕНИЕ ТРАНСГЕНДЕРНЫХ И КВИР ЛЮДЕЙ НА ПОСТСО...
АКТУАЛЬНО СОЦИО-ЭКОНОМИЧЕСКОЕ ПОЛОЖЕНИЕ ТРАНСГЕНДЕРНЫХ И КВИР ЛЮДЕЙ НА ПОСТСО...АКТУАЛЬНО СОЦИО-ЭКОНОМИЧЕСКОЕ ПОЛОЖЕНИЕ ТРАНСГЕНДЕРНЫХ И КВИР ЛЮДЕЙ НА ПОСТСО...
АКТУАЛЬНО СОЦИО-ЭКОНОМИЧЕСКОЕ ПОЛОЖЕНИЕ ТРАНСГЕНДЕРНЫХ И КВИР ЛЮДЕЙ НА ПОСТСО...
 
Learning flash by Ms. Payal Narula
Learning flash by Ms. Payal Narula Learning flash by Ms. Payal Narula
Learning flash by Ms. Payal Narula
 
English
EnglishEnglish
English
 
Intro to Flash 8 welcome & course outline (2008)
Intro to Flash 8 welcome & course outline (2008)Intro to Flash 8 welcome & course outline (2008)
Intro to Flash 8 welcome & course outline (2008)
 

Similar to An Introduction to Game Programming with Flash: Object Oriented Programming

Lies Told By The Kotlin Compiler
Lies Told By The Kotlin CompilerLies Told By The Kotlin Compiler
Lies Told By The Kotlin CompilerGarth Gilmour
 
Lies Told By The Kotlin Compiler
Lies Told By The Kotlin CompilerLies Told By The Kotlin Compiler
Lies Told By The Kotlin CompilerGarth Gilmour
 
Introduction to kotlin + spring boot demo
Introduction to kotlin + spring boot demoIntroduction to kotlin + spring boot demo
Introduction to kotlin + spring boot demoMuhammad Abdullah
 
On deriving the private key from a public key
On deriving the private key from a public keyOn deriving the private key from a public key
On deriving the private key from a public keyDharmalingam Ganesan
 
Functional Programming You Already Know - Kevlin Henney - Codemotion Rome 2015
Functional Programming You Already Know - Kevlin Henney - Codemotion Rome 2015Functional Programming You Already Know - Kevlin Henney - Codemotion Rome 2015
Functional Programming You Already Know - Kevlin Henney - Codemotion Rome 2015Codemotion
 
Implementation of oop concept in c++
Implementation of oop concept in c++Implementation of oop concept in c++
Implementation of oop concept in c++Swarup Kumar Boro
 
The mighty js_function
The mighty js_functionThe mighty js_function
The mighty js_functiontimotheeg
 
Embedded Rust and more
Embedded Rust and moreEmbedded Rust and more
Embedded Rust and moreKiwamu Okabe
 
Design Patterns in Game Programming
Design Patterns in Game ProgrammingDesign Patterns in Game Programming
Design Patterns in Game ProgrammingBruno Cicanci
 
Python-GTK
Python-GTKPython-GTK
Python-GTKYuren Ju
 
Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1Robert Stern
 
Python GTK (Hacking Camp)
Python GTK (Hacking Camp)Python GTK (Hacking Camp)
Python GTK (Hacking Camp)Yuren Ju
 
Design patterns
Design patternsDesign patterns
Design patternsBa Tran
 
Trivadis TechEvent 2016 Go - The Cloud Programming Language by Andija Sisko
Trivadis TechEvent 2016 Go - The Cloud Programming Language by Andija SiskoTrivadis TechEvent 2016 Go - The Cloud Programming Language by Andija Sisko
Trivadis TechEvent 2016 Go - The Cloud Programming Language by Andija SiskoTrivadis
 
Spinners, Adapters & Fragment Communication
Spinners, Adapters & Fragment CommunicationSpinners, Adapters & Fragment Communication
Spinners, Adapters & Fragment CommunicationCITSimon
 

Similar to An Introduction to Game Programming with Flash: Object Oriented Programming (20)

Lies Told By The Kotlin Compiler
Lies Told By The Kotlin CompilerLies Told By The Kotlin Compiler
Lies Told By The Kotlin Compiler
 
05. haskell streaming io
05. haskell streaming io05. haskell streaming io
05. haskell streaming io
 
Lies Told By The Kotlin Compiler
Lies Told By The Kotlin CompilerLies Told By The Kotlin Compiler
Lies Told By The Kotlin Compiler
 
Java For Automation
Java   For AutomationJava   For Automation
Java For Automation
 
Introduction to kotlin + spring boot demo
Introduction to kotlin + spring boot demoIntroduction to kotlin + spring boot demo
Introduction to kotlin + spring boot demo
 
On deriving the private key from a public key
On deriving the private key from a public keyOn deriving the private key from a public key
On deriving the private key from a public key
 
Class or Object
Class or ObjectClass or Object
Class or Object
 
Lecture5
Lecture5Lecture5
Lecture5
 
Functional Programming You Already Know - Kevlin Henney - Codemotion Rome 2015
Functional Programming You Already Know - Kevlin Henney - Codemotion Rome 2015Functional Programming You Already Know - Kevlin Henney - Codemotion Rome 2015
Functional Programming You Already Know - Kevlin Henney - Codemotion Rome 2015
 
Implementation of oop concept in c++
Implementation of oop concept in c++Implementation of oop concept in c++
Implementation of oop concept in c++
 
The mighty js_function
The mighty js_functionThe mighty js_function
The mighty js_function
 
Embedded Rust and more
Embedded Rust and moreEmbedded Rust and more
Embedded Rust and more
 
Kotlin
KotlinKotlin
Kotlin
 
Design Patterns in Game Programming
Design Patterns in Game ProgrammingDesign Patterns in Game Programming
Design Patterns in Game Programming
 
Python-GTK
Python-GTKPython-GTK
Python-GTK
 
Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1
 
Python GTK (Hacking Camp)
Python GTK (Hacking Camp)Python GTK (Hacking Camp)
Python GTK (Hacking Camp)
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Trivadis TechEvent 2016 Go - The Cloud Programming Language by Andija Sisko
Trivadis TechEvent 2016 Go - The Cloud Programming Language by Andija SiskoTrivadis TechEvent 2016 Go - The Cloud Programming Language by Andija Sisko
Trivadis TechEvent 2016 Go - The Cloud Programming Language by Andija Sisko
 
Spinners, Adapters & Fragment Communication
Spinners, Adapters & Fragment CommunicationSpinners, Adapters & Fragment Communication
Spinners, Adapters & Fragment Communication
 

Recently uploaded

Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 

Recently uploaded (20)

Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 

An Introduction to Game Programming with Flash: Object Oriented Programming

  • 1. An Introducton to Game Programming with Flash 2. Object Oriented Programming
  • 2. What is O-O? Researching problem from a perspectve of: ● Objects ● Dependencies ● Relatons What can be O-O? ● Analysis ● Design ● Programming
  • 3. Why O-O? Easier: ● Analysis ● Design ● Programming and maintenance Why is it so important?
  • 4. package foo { public class Person { private var name:String; public function Person(name:String) { this.name = name; } public function introduce():String { return "My name is " + name; } } } 1 2 3 4 5 Class
  • 5. import foo.Person; var person:Person = new Person("John Smith"); person.introduce(); //My name is John Smith 1 2 Object
  • 6. package foo { public class Rapper extends Person { public function Rapper(name:String) { super(name); } } } import foo.Rapper; var snoopDog:Rapper = new Rapper("Snoop Dogg"); snoopDog.introduce(); //My name is Snoop Dogg 1 2 3 Inheritance
  • 7. package foo { public class Rapper extends Person { public function Rapper(name:String) { super(name); } override public function introduce():String { return "YO! " + super.introduce(); } } } import foo.Rapper; var snoopDog:Rapper = new Rapper("Snoop Dogg"); snoopDog.introduce(); //YO! My name is Snoop Dogg 2 3 Polymorphism 1
  • 8. Enakpsulaton Hiding implementaton and exposing only desired API Access modifiers: ● public – for everyone ● protected – only for the same class or subclasses ● internal – only for the same package ● private – only the same class
  • 9. Interface package foo { public interface IPerson { function introduce():String; } } 1 2
  • 10. Statc fields and methods package foo { public class Math { public static const PI:Number = 3.14; public static function abs(value:Number):Number { return (value >= 0) ? value : -value; } } } Math.PI; //3.14 Math.abs(-5); //5 1 2 3
  • 11. Good practces ● Single Responsibility Principle ● Open/Closed Principle ● Liskov Substtuton Principle ● Interface Segregaton Principle ● Dependency Inversion Principle ● ... ● Don't Repeat Yourself ● Law of Demeter ● ... ● COMMON SENCE!
  • 14. Task 1 Moving a Giant: ● Giant can move horizontally and vertcally ● smoothing
  • 15. Task 2 Enemies: ● Two classes should inherit from Enemy ● Enemy_1 moves quickly, along straight line ● Enemy_1 need single hit to be destroyed ● Enemy_2 moves slowly, along sine wave ● Enemy_2 needs double hit to be destroyed enemy_1 enemy_2
  • 16. Task 3 Giant – Enemy collision: ● Collision causes showing boom animaton ● Collision takes one Giant's life
  • 17. Task 4 Shootng enemies: ● Enemies can shoot with random frequency ● Hitting Giant with bullet takes one life