00001 00002 // 00003 // Das Tank - Copyright (C) 2006, 2007 Windsor Schmidt <windsor@windsorworld.net> 00004 // 00005 // This program is free software; you can redistribute it and/or modify it 00006 // under the terms of the GNU General Public License as published by the Free 00007 // Software Foundation; either version 2 of the License, or (at your option) 00008 // any later version. 00009 // 00010 // This program is distributed in the hope that it will be useful, but WITHOUT 00011 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 00013 // more details. 00014 // 00015 // You should have received a copy of the GNU General Public License along with 00016 // this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00017 // Place, Suite 330, Boston, MA 02111-1307 USA 00018 // 00020 00021 00022 #ifndef STDAFX 00023 #include "stdafx.h" 00024 #endif 00025 00027 // Class declarations 00029 class CWorld; 00030 00031 00033 // class definitions 00035 00036 00045 class CTile 00046 { 00047 public: 00048 int iTexture; 00049 int iType; 00050 int iTileEffect; 00051 bool bPassable; 00052 int iDamage; 00053 00054 CTile * Previous; 00055 CTile * Next; 00056 CTile::CTile(void); 00057 }; 00058 00069 class CEffect 00070 { 00071 public: 00072 int iType; 00073 00074 bool bExpired; 00075 00076 PSystem * PSys; 00077 Shockwave * SWave; 00078 TileAnim * TAnim; 00079 TileStorm * TStorm; 00080 MiniShock * MShock; 00081 00082 CEffect * Previous; 00083 CEffect * Next; 00084 00085 CEffect::~CEffect(void); 00086 CEffect::CEffect(int type); 00087 00088 void CEffect::Draw(void); 00089 bool CEffect::Step(float timeDelta); 00090 }; 00091 00092 00100 class CGeometry 00101 { 00102 bool bVisible; 00103 CGeometry * Previous; 00104 CGeometry * Next; 00105 public: 00106 }; 00107 00108 00114 class CVector2D 00115 { 00116 public: 00117 float x; 00118 float y; 00119 CVector2D::CVector2D(void); 00120 }; 00121 00122 00134 class CObject 00135 { 00136 protected: 00137 CGeometry * Geometry; 00138 CEffect * Effects; 00139 public: 00140 CWorld * ParentWorld; 00141 Vector Position; 00142 Vector OldPosition; 00143 Vector Acceleration; 00144 Vector Velocity; 00145 CObject * Previous; 00146 CObject * Next; 00147 CObject * Owner; 00148 float fBBLeft; 00149 float fBBRight; 00150 float fBBBottom; 00151 float fBBTop; 00152 float fDrawLeft; 00153 float fDrawRight; 00154 float fDrawBottom; 00155 float fDrawTop; 00156 float fAngle; 00157 float fSubAngle; 00158 int iOwnCount; 00159 int iType; 00160 int iHealth; 00161 int iDamage; 00162 int iLives; 00163 int iTint; 00164 int iRemovalEffects; 00165 int iRemovalEffect[8]; 00166 int iRemovalSound; 00167 int iDamageSound; 00168 bool iInput[8]; 00169 int iTexture; 00170 int iWeapon; 00171 int iAmmo; 00172 bool bCheckedForCollision; 00173 bool bDying; 00174 bool bVisible; 00175 00176 // animation variables 00177 int iCreationAnim; 00178 int iCreationAnimSpeed; 00179 int iNormalAnim; 00180 int iNormalAnimSpeed; 00181 int iRemovalAnim; 00182 int iRemovalAnimSpeed; 00183 Uint32 iAnimSpeed[3]; 00184 bool bAnimCycle; 00185 bool bAnimating; 00186 int iCurrentFrame; 00187 Uint32 iAnimTimeStamp; 00188 int iLingerTime; 00189 00190 // functions 00191 CObject::CObject(void); 00192 CObject::CObject(int typeID, CWorld * ThisWorld); 00193 int CObject::Draw(void); 00194 void CObject::StartAnimating(void); 00195 void CObject::StopAnimating(void); 00196 void CObject::SetBB(float left, float right, float bottom, float top); 00197 }; 00198 00199 00209 class CWorld 00210 { 00211 public: 00212 gcn::Gui * GUI; 00213 bool bGameOver; 00214 bool bTakeInput; 00215 int iStartingState; 00216 int iRenderStyle; 00217 float fZoomBias; 00218 float fFinalZoom; 00219 int iObjectCount; 00220 int iEffectCount; 00221 int iNumCollisions; 00222 Uint32 iCurrentTime; 00223 Uint32 iOldTime; 00224 char * musicFile; 00225 CTile tiles[MAP_SIZE * MAP_SIZE]; 00226 CObject * Player[4]; 00227 CObject * Objects; 00228 PSystem * PSystems; 00229 CEffect * Effects; 00230 00231 CWorld::CWorld(void); 00232 00233 int CWorld::AddObject(CObject * Obj); 00234 int CWorld::RemoveObject(CObject * Obj); 00235 00236 int CWorld::LoadLevel(const char * filename); 00237 00238 int CWorld::AddEffect(CEffect * Effect); 00239 int CWorld::RemoveEffect(CEffect * Effect); 00240 00241 void CWorld::UpdateEffects(float timeDelta); 00242 void CWorld::DrawEffects(void); 00243 };
Copyright Windsor Schmidt 2006 - All rights reserved.