|
|
|
DESCRIPTION:
|
This is the Sprite Object class. It defines the basic attributes each
sprite object will have, and provides opperator methods to modify these
attributes in run time.
This class has setup methods to get each sprite "orientated" to the
drawing DC (setScreenSize, setBitmap, setDrawingDC) and opperator methods
to change the attributes (move, setSpeed) and lastly a method to work with how
windows does GDI graphics (draw).
|
|
|
METHOD:
|
CONSTRUCTOR (NONE)
|
|
DESCRIPTION:
|
Basic constructor setup, no extra procedures are included.
|
|
|
|
METHOD:
|
destructor (NONE)
|
|
DESCRIPTION:
|
Will delete the object bimpate handle (if one is stored to this object),
as well as delete the given DC (if one was stored to this object).
|
|
|
|
METHOD:
|
setBitmap (hBitMap)
|
|
DESCRIPTION:
|
Creates a DC for this object and selects the passes hBitmap into it.
|
|
|
hBitmap
|
The handle of the bitmap to be used with this object.
|
|
|
|
|
DESCRIPTION:
|
Randomly moves this sprite object's x-y location, at a random speed.
NOTE: The spite's location variable are only ajusted, and not redrawn.
|
|
|
|
|
DESCRIPTION:
|
Draws the sprite object onto the displayed DC according to its x-y location.
|
|
|
|
METHOD:
|
setSpeed (dwSpeed)
|
|
DESCRIPTION:
|
Used to adjust the sprinte objects speed of movement.
|
|
|
dwSpeed
|
The value to set the new speed to.
|
|
|
|
METHOD:
|
setScreenSize (dwWidth, dwHeight)
|
|
DESCRIPTION:
|
Used to specify the drawing area's sreen size.
|
|
|
dwWidth
|
The screen width (DWORD).
|
|
|
dwHeight
|
The screen heigth (DWORD).
|
|
|
|
METHOD:
|
setDrawingDC (hDC)
|
|
DESCRIPTION:
|
Used to set the global DC that is to be displayed with the GUI. Each
sprite needs this information such it can draw itself onto the same
DC and thus be shown.
|
|
|
hDC
|
A non volitile DC that this sprite can be drawn onto.
|
|
|
|