C:/DevKitPro/!MDuel/source/pickup.h

Go to the documentation of this file.
00001 /*
00002  * Marshmallow Duel DS v2
00003  * Copyright © 2007 Sam Pospischil http://pospi.spadgos.com
00004  * 
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  * 
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013  * GNU General Public License for more details.
00014  * 
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00018  */
00019 
00020 #ifndef _PICKUP_H
00021 #define _PICKUP_H
00022 
00023 #include <PA9.h>
00024 #include <dswifi9.h>
00025 #include <vector>
00026         using std::vector;
00027 #include "macros.h"
00028 #include "spriteObject.h"
00029 #include "gameManager.h"
00030 
00031 //forward declaration
00032 class Player;
00033 
00042 class Pickup : public spriteObject
00043 {
00044         public:
00045                 Pickup(spriteManager *newgm, pickupSpawner *mySpawner, u8 lifeSeconds, s16 nx, s16 ny, u8 type, gameManager::pickupGraphics* graphicSet);
00046                 virtual ~Pickup();
00047                 
00048                 virtual void updateSprite();
00049                 virtual void collidingWith(spriteObject *other);
00050                 virtual bool isColliding(spriteObject *other, bool checkReverse = true) const;
00051                 
00058                 enum pickupType {
00059                         PT_SKULL, PT_1000V, PT_INVIS, PT_MINE, PT_GUN, PT_TNT,
00060                         PT_BOOT, PT_GRENADE, PT_PUCK, PT_CHUT, PT_HOOK, PT_WARP,
00061                         PT_MAGNET, PT_NET, PT_SHIELD, PT_DUNCE, PT_WEASEL, PT_BOOMERANG
00062                 };
00063                 void setType(u8 newType);
00065                 pickupType getType() const {return myType;}
00067                 void setSpawner(pickupSpawner *p) { spawner = p; }
00069                 bool shouldExplode() { return exploding; }
00070                 
00072                 static const u8 NUMPICKUPVARIATIONS = 18;
00073 
00074                 void playerTouchAction(Player* other);
00075         protected:
00077                 gameManager* gm;
00078         private:
00080                 pickupSpawner* spawner;
00082                 bool exploding;
00084                 pickupType myType;
00086                 gameManager::pickupGraphics* myGFXset;
00087                 
00088                 void makeIcon(u8 frame);
00090                 spriteObject* myIcon;
00091                 
00093                 static const u16 MINX = 8;
00095                 static const u16 MINY = 8;
00097                 static const u16 MAXX = 248;
00099                 static const u16 MAXY = 176;
00100 };
00101 
00102 #endif

Generated on Tue Mar 13 23:27:53 2007 for MDuel DS by  doxygen 1.5.1-p1