Section 4

Now that we have the masking, we need to apply them.

removeLaserFromInactiveLeftSide
    (self cell activeSegments at: #west) ifFalse: [self maskForSouthWest].
    (self cell activeSegments at: #east) ifFalse: [self maskForNorthEast].

removeLaserFromInactiveRightSide
    (self cell activeSegments at: #west) ifFalse: [self maskForNorthWest].
    (self cell activeSegments at: #east) ifFalse: [self maskForSouthEast].

removeLaserFromInactiveSide
    self cell isLeft
        ifTrue: [self removeLaserFromInactiveLeftSide]
        ifFalse: [self removeLaserFromInactiveRightSide]

And finally, include this sequence when we draw the laser.

renderLaser
    self cell isOff ifTrue: [^self].
    self renderLaserVertical.
    self renderLaserHorizontal.
    self renderLaserVerticalCenter.
    self removeLaserFromInactiveSide.
    self renderMirror.

Index Page Next Page

Copyright © 2007, 2008, 2009, 2010 Stephan B Wessels    stevewessels@me.com