QwMobilePositionedSprite Class Reference


#include <QwSpriteField.h>

Inherits QwPositionedSprite.

List of all member functions.

Public Members


Detailed Description

A QwPositionedSprite which has velocity as well as position, and a bounding area in which it may move. This class is useful for simple applications where objects have simple motion. More complex uses will require use of one of the QwPositionedSprite derived classes, QwSprite or QwRealSprite.

Member Function Documentation

QwMobilePositionedSprite::QwMobilePositionedSprite ()

Create a QwPositionedSprite without defining its image sequence. Note that you must call setSequence(QwSpritePixmapSequence&) before doing anything else with the sprite.

QwMobilePositionedSprite::QwMobilePositionedSprite (QwSpritePixmapSequence&)

Create a QwPositionedSprite which uses images from the given sequence.

void QwMobilePositionedSprite::adoptPlayfieldBounds ()

Use the width and height of the sprite's playfield as the bounds.

void QwMobilePositionedSprite::bounds (COORD l, COORD t, COORD r, COORD b)

Set the bounds of the sprite's motion.

void QwMobilePositionedSprite::forward (COORD multiplier)

Move forward (or backward if multiplier is negative) by the given amount multiplied by the current velocity of the sprite.

void QwMobilePositionedSprite::forward (COORD multiplier, int frame)

Move forward (or backward if multiplier is negative) by the given amount multiplied by the current velocity of the sprite, and set the frame to the given index.

void QwMobilePositionedSprite::moveTo (COORD x, COORD y, int frame) [virtual]

Override to implement bounds action.

bool QwMobilePositionedSprite::outOfBounds ()

Returns true if the sprite has moved out of its bounds. This should only happen if the bounds action is set to Ignore.

void QwMobilePositionedSprite::setBoundsAction (int a)

Set the action to perform when the sprite hits its bounds. It can Ignore the bounds, continuing on. It can Stop moving at the boundary. It can Wrap from one side of the boundary to the other. It can Bounce away from the boundary as it hits.

void QwMobilePositionedSprite::setVelocity (COORD dX, COORD dY)

Set the velocity of the sprite. It will only actually move when QwMobilePositionedSprite::forward is called.


This file is part of a class set, copyright © 1995-96 Warwick Allison

It was generated from the following files:


Generated at 15:00, 1996/10/21