• Main Page
  • Classes
  • Files
  • File List
  • File Members

code/include/defines/defines_Powerup.h

Go to the documentation of this file.
00001 /*
00002  * TetriCycle
00003  * Copyright (C) 2009, 2010 Cale Scholl
00004  *
00005  * This file is part of TetriCycle.
00006  *
00007  * TetriCycle is free software: you can redistribute it and/or modify
00008  * it under the terms of the GNU Lesser General Public License as published
00009  * by the Free Software Foundation, either version 3 of the License, or
00010  * (at your option) any later version.
00011  *
00012  * TetriCycle is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public License
00018  * along with TetriCycle.  If not, see <http://www.gnu.org/licenses/>.
00019  */
00020 
00021 /** @file defines_Powerup.h
00022  * @brief Defines for the Powerup class.
00023  * @author Cale Scholl / calvinss4
00024  */
00025 
00026 #pragma once
00027 #ifndef __DEFINES_POWERUP_H__
00028 #define __DEFINES_POWERUP_H__
00029 
00030 #include <gctypes.h> // for u8
00031 
00032 #define DEFAULT_POWERUP_DURATION 10000 // milliseconds
00033 #define BIG_HAND_SCALE 2.5
00034 
00035 // for drawing powerup textures
00036 #define POWERUP_Y_OFFSET 25
00037 #define POWERUP_X_OFFSET 5
00038 #define POWERUP_WIDTH 32
00039 
00040 /// For code inside a function that should only be executed once.
00041 #define STATIC(code) \
00042   static bool firstTime = true; \
00043   if (firstTime) \
00044   { \
00045     firstTime = false; \
00046     code \
00047   }
00048 
00049 /// Every powerup class is represented by a unique PowerupId.
00050 typedef u8 PowerupId; // u8 allows 255 powerups
00051 
00052 /// A PowerupId that represents a null powerup.
00053 #define POWERUP_ID_NONE 255 // max value of u8
00054 
00055 /// The total number of powerup classes (determined at runtime).
00056 extern int g_totalPowerups;
00057 
00058 /// Determines what players are the target of this powerup.
00059 enum PowerupTarget
00060 {
00061   POWERUP_TARGET_ONE,        ///< Affects the target player.
00062   POWERUP_TARGET_ALL,        ///< Affects all players.
00063   POWERUP_TARGET_ALL_BUT_ONE ///< Affects all but the target player.
00064 };
00065 
00066 #endif // __DEFINES_POWERUP_H__

Generated on Wed Oct 20 2010 17:06:58 for TetriCycle by  doxygen 1.7.1