C:/DevKitPro/!MDuel/source/wp_mine_proj.cpp

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 #include "wp_mine_proj.h"
00021 #include "player.h"
00022 #include "spriteManager.h"
00023 #include "gameManager.h"
00024 
00025 wp_mine_proj::wp_mine_proj(gameManager* newsm, Player* own) : spriteObject(newsm), owner(own)
00026 {
00027         #ifdef __MDDEBUG
00028         className = "wp_mine_proj";
00029         macros::debugMessage(className, "constructor");
00030         #endif
00031         //this one doesnt need any graphics yey
00032         setCollision(COL_SOLID);
00033         setLayer(1);
00034         setBounds(-1, 1, 1, -1);        //teenie weenie
00035         #ifdef __WITHSOUND
00036         playSound(&dynamic_cast<gameManager *>(sm)->mineDrop);
00037         #endif
00038 }
00039 
00040 wp_mine_proj::~wp_mine_proj()
00041 {
00042         gameManager *gm = dynamic_cast<gameManager *>(sm);
00043         
00044         if (gm->isResetting())
00045                 return;
00046         
00047         u8 f[3] = {10, 11, 12};
00048         vector<u8> temp(f, f+3);
00049         gm->createSingleFireSprite(gm->FXSprite.palleteID, (owner == gm->player1 ? gm->spawnGFX[0] : gm->spawnGFX[1]), temp, TICKSPERFRAME*2, getx(), gety()-16, OBJ_SIZE_32X32, 16, 16);
00050         #ifdef __WITHSOUND
00051         playSound(&gm->mineExp);
00052         #endif
00053 }

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