ActionScript 3.0 Design Patterns
80 | Chapter 2: Factory Method Pattern Extended Example: Color Printing The print shop has been going gangbusters! The manager d ...
Extended Example: Color Printing | 81 New Creator Classes: Integrating a Parameterized Factory Method As with the product classe ...
82 | Chapter 2: Factory Method Pattern We have created a new hierarchy of related classes for the new print centers, with parame ...
Extended Example: Color Printing | 83 Clients Clients need to instantiate the new print center classes to access the color print ...
84 | Chapter 2: Factory Method Pattern Key OOP Concepts Used in the Factory Method Pattern Incorporating changes that were not a ...
Example: Sprite Factory | 85 is not a productive application, but it will serve as a springboard to thevertical shooter game tha ...
86 | Chapter 2: Factory Method Pattern to implement default behavior common to all shape widgets in the definition. In addition, ...
Example: Sprite Factory | 87 Creator Classes: Shape Creators TheShapeCreatorclass shown in Example 2-26 defines the abstract int ...
88 | Chapter 2: Factory Method Pattern Thedraw( )method takes four parameters: the kind of shape to be created, the stage object ...
Example: Sprite Factory | 89 Clients Note that when a client calls the creator classes, it needs to pass an instance of the stag ...
90 | Chapter 2: Factory Method Pattern // draw filled shapes filledShapeCreator.draw(FilledShapeCreator.CIRCLE, this.stage, 50, ...
Example: Vertical Shooter Game | 91 Figure 2-11 shows the Project window for the example. It consists of two packages that encap ...
92 | Chapter 2: Factory Method Pattern checking if the projectile has gone beyond the top or bottom boundaries of the stage. If ...
Example: Vertical Shooter Game | 93 The default behaviors defined in theProjectileclass are suitable for most of the derived con ...
94 | Chapter 2: Factory Method Pattern Projectiles are drawn using methods available in theGraphicsclass accessible via the grap ...
Example: Vertical Shooter Game | 95 TheAlienShip(Example 2-34) andHeroShip(Example 2-35) classes extend theShip (Example 2-33) c ...
96 | Chapter 2: Factory Method Pattern var cProjectile:uint = aProjectiles[Math.floor(Math.random( ) * aProjectiles.length)]; we ...
Example: Vertical Shooter Game | 97 Note theinitShip( )methods in both derived classes attach event handlers to inter- cept even ...
98 | Chapter 2: Factory Method Pattern TheAlienWeapon(Example 2-37) andHeroWeapon(Example 2-38) classes extend the Weapon class ...
Example: Vertical Shooter Game | 99 ShipCreator The concrete classShipCreator(Example 2-39) encapsulates ship creation. We don’t ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf