MoofWars/TShipSprite.h

/*
    File:       TShipSprite.h
 
    Contains:   This is the class used to represent the friendly ship in the game.  Eventually,
                one ship class will represent both friendly and enemy ships, since the only
                major difference is the keyset.  A computer controlled ship could be 
                different.
 
    Written by: Timothy Carroll 
 
    Copyright:  Copyright © 1996-1999 by Apple Computer, Inc., All Rights Reserved.
 
                You may incorporate this Apple sample source code into your program(s) without
                restriction. This Apple sample source code has been provided "AS IS" and the
                responsibility for its operation is yours. You are not permitted to redistribute
                this Apple sample source code as "Apple sample source code" after having made
                changes. If you're going to re-distribute the source, we require that you make
                it clear in the source that the code was descended from Apple sample source
                code, but that you've made changes.
 
    Change History (most recent first):
                7/2/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
                
                8/15/96     Timothy Carroll Initial Release
                
 
*/
 
#ifndef _TSHIPSPRITE_
#define _TSHIPSPRITE_
 
#pragma once
 
#include "TSprite.h"
#include "TSpriteCollection.h"
 
#if PRAGMA_STRUCT_ALIGN
#pragma options align=power
#endif
 
 
struct TShipSpriteData
{
    TSpriteData spriteData;
    SInt16      rotateInterval; // turning rate;
    SInt16      shotInterval;   // firing rate;
    TSpriteCollection *shotsGroup;   // where my shots should be added.
};
 
typedef struct TShipSpriteData **TShipSpriteDataHandle;
 
class TShipSprite : public TSprite
{
    public:
    
    enum {
        kSpriteType = 'SHIP'
    };
    
    TShipSprite (TShipSpriteData *data);
    ~TShipSprite (void);
    
    virtual void ProcessSprite (void);
    virtual void Collision (TSprite *theSprite);
    
    protected:
    SInt16 fRotateInterval;
    SInt16 fRotateValue;
    SInt16 fShotInterval;
    SInt16 fShotValue;
    SInt16 fDirection;
    TSpriteCollection *fShotsGroup;
};
 
#if PRAGMA_STRUCT_ALIGN
#pragma options align=reset
#endif
 
 
#endif /* _TSHIPSPRITE_ */