Background for all game screens. More...
#include <Background.h>
Public Member Functions | |
Background (CIwFVec2 screenDimensions) | |
~Background () | |
void | Update (double deltaTime) |
void | Draw () |
Protected Attributes | |
CIw2DImage * | m_hillsImage |
Image for the hills. | |
CIw2DImage * | m_cloudsImage |
Image for the clouds. | |
CIwFVec2 | m_screenDimensions |
Pixel dimensions of the screen. | |
CIwFVec2 | m_cloudPos |
Position of the clouds. | |
float | m_cloudSpeed |
Scrolling speed for the clouds. | |
Static Protected Attributes | |
static const int | m_cloudY = 100 |
Fixed Y position for the clouds. |
Background for all game screens.
Background with hills and scrolling clouds.
Background::Background | ( | CIwFVec2 | screenDimensions | ) |
Constructor.
Create a new background.
[in] | screenDimensions | Width and height of the screen in pixels. |
Background::~Background | ( | ) |
Destructor.
Destroy the background and free any associated memory.
void Background::Draw | ( | ) |
Draw background.
Draws the hills and clouds.
void Background::Update | ( | double | deltaTime | ) |
Update background.
Scrolls the clouds across the sky.
[in] | deltaTime | Time since the last update. |