
2679.4. Shadows and Reflections
//========================================================================
// Draw the plane and shadow
//========================================================================
void Plane::draw()
{
// Draw shadow
planeY = spriteData.y; // Save plane Y
spriteData.y = planeNS::SHADOW_Y;
// Draw shadow using colorFilter 25% alpha
shadow.draw(spriteData, graphicsNS::ALPHA25 & graphicsNS::BLACK);
spriteData.y = planeY; // Restore plane Y
// Draw plane
Entity::draw();
}
Listing 9.8. Drawing the plane and shadow.
e plane’s draw function draws the shadow then the plane. We draw the shadow rst
because we want the plane to alwa ...