#include <Play.h>
Inherits Scene.
Inheritance diagram for Play:
Public Member Functions | |
Play () | |
virtual | ~Play () |
bool | load (Application *parent) |
bool | unload () |
bool | update () |
bool | drawFrame () |
void | handleKeys () |
Protected Member Functions | |
bool | loadObjects () |
bool | loadSounds () |
bool | loadTextures () |
int | playerCollission (Vec3 pos, float size) |
void | bot (int playerID) |
void | serverLoop () |
void | networkLoop () |
void | applyExtras (int playerID, int type, bool add=true) |
void | dealExtras () |
void | newExtras (int type, float x, float z) |
void | drawGrenades () |
void | drawExplosions () |
void | drawProjectiles () |
void | drawPlayers () |
void | drawPlayer (int playerID) |
void | drawSpawn (int playerID) |
void | drawParticleSystems () |
void | drawShadow (Vec3 pos, float size) |
void | drawLifebar () |
void | drawExtras () |
void | drawAvatar (int model, bool clear=false) |
void | setSpawnPlayer (int playerID) |
void | setPlayerCam (int playerID) |
void | throwGrenade (int playerID, Vec3 pos, Vec3 vel, float life, float strength) |
void | fireProjectile (int playerID, Vec3 pos, Vec3 vel, float strength) |
void | createExplosion (Vec3 pos, float power, bool sphere=false) |
int | startParticleSystem (Vec3 pos, int type) |
void | grenadeExplode (int ownerID, Vec3 pos, float strength) |
void | dealDamage (int onwerID, int playerID, float damage) |
void | setParticleSystemPos (int id, Vec3 pos) |
Protected Attributes | |
TextureID | m_textures [PLAY_TEXTURES] |
Sound | m_sounds [PLAY_SOUNDS] |
OpenGLObject * | m_objects [PLAY_OBJECTS] |
Music | m_music |
OpenGLParticleSystem | m_particleSystems [MAX_PARTICLESYSTEMS] |
Granade | m_granades [MAX_GRANADES] |
Explosion | m_explosions [MAX_EXPLOSIONS] |
Projectile | m_projectiles [MAX_PROJECTILES] |
LevelInfo | m_lvl |
ObjLevel * | m_objLevel |
float | m_timeStart |
float | m_timeEnd |
PlayExtras | m_extras [PLAY_EXTRAS_SIMULTANEOUS] |
Definition at line 99 of file Play.h.
|
Author: Petter Alstermark, petter@alstermark.com Definition at line 12 of file Play.cpp. References m_objects, m_objLevel, and PLAY_OBJECTS. |
|
Definition at line 25 of file Play.cpp. References unload(). Here is the call graph for this function: |
|
Definition at line 1490 of file Play.cpp. References SPlayer::ammo, SPlayer::extras, g_players, g_time, SPlayer::life, PLAY_EXTRAS_AMMO, PLAY_EXTRAS_FAST, PLAY_EXTRAS_FLIPVIEW, PLAY_EXTRAS_IMMORTAL, PLAY_EXTRAS_INVISIBLE, PLAY_EXTRAS_LIFE, PLAY_EXTRAS_SHAKE, PLAY_EXTRAS_SLOW, and SPlayer::timeExtras. Referenced by networkLoop(). |
|
Definition at line 1667 of file Play.cpp. References SPlayer::angle, ObjLevel::collission(), SPlayer::dir, fireProjectile(), g_frameTime, g_models, g_myPlayerID, g_players, g_time, MilkShape::guns, ObjLevel::isWater(), m_objLevel, SPlayer::moving, Vec3::normalize(), PI, PIdiv180, PLAYER_STATE_USER, SPlayer::pos, SWeapon::power, SWeapon::reload, SWeapon::speed, SPLAYER_MAX_PLAYERS, SPlayer::state, throwGrenade(), SPlayer::weapon, Vec3::x, Vec3::y, and Vec3::z. Here is the call graph for this function: |
|
Definition at line 970 of file Play.cpp. References Explosion::explode(), m_explosions, and MAX_EXPLOSIONS. Referenced by drawProjectiles(), grenadeExplode(), and networkLoop(). Here is the call graph for this function: |
|
Definition at line 1040 of file Play.cpp. References g_players, gne, Gne::isServer(), SPlayer::life, PLAY_EXTRAS_IMMORTAL, PLAYER_STATE_USER, and Gne::setPlayerDeath(). Referenced by drawProjectiles(), and grenadeExplode(). Here is the call graph for this function: |
|
float maxTime = 0.0f; int avaiable = 0; for (unsigned int i=0; i<PLAY_EXTRAS_SIMULTANEOUS; i++) { if (m_extras[i].type == PLAY_EXTRAS_NONE) { avaiable = i; break; } if (m_extras[i].time > maxTime) { maxTime = m_extras[i].time; avaiable = i; } } Definition at line 1585 of file Play.cpp. References Gne::dealExtras(), g_time, ObjLevel::getExtras(), gne, int(), Gne::isServer(), m_objLevel, PLAY_EXTRAS, round, Vec3::x, and Vec3::z. Referenced by serverLoop(). Here is the call graph for this function: |
|
Definition at line 1364 of file Play.cpp. References Renderer::apply(), COLOR, GL_TEXTURE0_ARB, glMultiTexCoord2fARB, Scene::m_parent, m_textures, ONE, Application::renderer, Renderer::setBlending(), Renderer::setMask(), and Renderer::setTextures(). Here is the call graph for this function: |
|
Definition at line 1054 of file Play.cpp. References Renderer::apply(), COLOR, Explosion::drawAndUpdate(), g_frameTime, LEQUAL, m_explosions, Scene::m_parent, m_textures, MAX_EXPLOSIONS, ONE, PLAY_TEX_PARTICLE, Application::renderer, Renderer::setBlending(), Renderer::setDepthFunc(), Renderer::setMask(), and Renderer::setTextures(). Referenced by drawFrame(). Here is the call graph for this function: |
|
Definition at line 1629 of file Play.cpp. References Renderer::apply(), COLOR, g_time, GL_TEXTURE0_ARB, glMultiTexCoord2fARB, m_extras, Scene::m_parent, m_textures, ONE, PLAY_EXTRAS_NONE, PLAY_EXTRAS_SIMULTANEOUS, PLAY_TEX_EXTRAS_OTHER, PlayExtras::pos, Application::renderer, Renderer::setBlending(), Renderer::setMask(), Renderer::setTextures(), Vec3::y, and Vec3::z. Referenced by drawFrame(). Here is the call graph for this function: |
|
|
Definition at line 982 of file Play.cpp. References Renderer::apply(), OpenGLObject::draw(), g_frameTime, Granade::getPos(), grenadeExplode(), m_granades, m_objects, m_objLevel, Scene::m_parent, m_textures, MAX_GRANADES, PLAY_OBJ_GRENADE, PLAY_TEX_GRENADE, Application::renderer, Renderer::setTextures(), update(), Vec3::x, Vec3::y, and Vec3::z. Referenced by drawFrame(). Here is the call graph for this function: |
|
Definition at line 1405 of file Play.cpp. References Renderer::apply(), COLOR, DST_COLOR, g_height, g_myPlayerID, g_players, g_time, g_width, GL_TEXTURE0_ARB, glMultiTexCoord2fARB, SPlayer::life, Scene::m_parent, m_textures, ONE, PLAY_EXTRAS_IMMORTAL, PLAY_TEX_LIFEBAR_BG, PLAY_TEX_LIFEBAR_FRAME, PLAY_TEX_LIFEBAR_GLOW, Application::renderer, Renderer::setBlending(), Renderer::setMask(), Renderer::setTextures(), and ZERO. Referenced by drawFrame(). Here is the call graph for this function: |
|
Definition at line 1287 of file Play.cpp. References Renderer::apply(), Application::camera, COLOR, OpenGLParticleSystem::drawAndUpdate(), g_frameTime, ParticleSystem::getPos(), LEQUAL, Scene::m_parent, m_particleSystems, m_textures, MAX_PARTICLESYSTEMS, ONE, PLAY_TEX_PARTICLE, Application::renderer, Renderer::setBlending(), Renderer::setDepthFunc(), Renderer::setMask(), Renderer::setTextures(), and Camera::sphereInFrustum(). Referenced by drawFrame(). Here is the call graph for this function: |
|
Definition at line 1160 of file Play.cpp. References SPlayer::angle, Renderer::apply(), Application::camera, COLOR, OpenGLObject::draw(), drawShadow(), SPlayer::extras, g_models, g_players, g_time, LEQUAL, m_objects, Scene::m_parent, m_textures, ONE, ONE_MINUS_SRC_ALPHA, PLAY_EXTRAS_IMMORTAL, PLAY_EXTRAS_INVISIBLE, PLAY_OBJ_SPHERE, PLAY_TEX_SPAWN_SPHERE, PLAYER_STATE_INVISIBLE, PLAYER_STATE_OFFLINE, PLAYER_STATE_SPAWNING, SPlayer::pos, MilkShape::render(), Application::renderer, Renderer::setBlending(), Renderer::setDepthFunc(), Renderer::setMask(), Renderer::setTextures(), Camera::sphereInFrustum(), SPlayer::state, SPlayer::textureID, Vec3::x, Vec3::y, and Vec3::z. Referenced by drawPlayers(). Here is the call graph for this function: |
|
Definition at line 1149 of file Play.cpp. References drawPlayer(), g_players, PLAYER_STATE_OFFLINE, and SPLAYER_MAX_PLAYERS. Referenced by drawFrame(). Here is the call graph for this function: |
|
Definition at line 1070 of file Play.cpp. References Renderer::apply(), ObjLevel::collission(), createExplosion(), dealDamage(), Projectile::die(), OpenGLObject::draw(), g_frameTime, g_myPlayerID, g_players, Projectile::getPos(), m_objects, m_objLevel, Scene::m_parent, m_projectiles, m_sounds, m_textures, MAX_PROJECTILES, Sound::play(), PLAY_OBJ_GRENADE, PLAY_SOUND_GUN_HIT, PLAY_TEX_GRENADE, SPlayer::pos, Application::renderer, Renderer::setTextures(), Projectile::update(), Vec3::x, Vec3::y, and Vec3::z. Referenced by drawFrame(). Here is the call graph for this function: |
|
Definition at line 1305 of file Play.cpp. References Renderer::apply(), COLOR, DST_COLOR, GL_TEXTURE0_ARB, glMultiTexCoord2fARB, Scene::m_parent, m_textures, PLAY_TEX_SHADOW, Application::renderer, Renderer::setBlending(), Renderer::setMask(), Renderer::setTextures(), Vec3::x, Vec3::z, and ZERO. Referenced by drawPlayer(). Here is the call graph for this function: |
|
|
|
Definition at line 957 of file Play.cpp. References Projectile::create(), m_projectiles, MAX_PROJECTILES, and Projectile::setPlayerID(). Referenced by bot(), handleKeys(), and networkLoop(). Here is the call graph for this function: |
|
Definition at line 1010 of file Play.cpp. References Application::camera, createExplosion(), dealDamage(), g_myPlayerID, g_players, Scene::m_parent, m_sounds, Sound::play(), PLAY_SOUND_GRENADE, PLAYER_STATE_OFFLINE, SPlayer::pos, Camera::shake(), and SPLAYER_MAX_PLAYERS. Referenced by drawGrenades(). Here is the call graph for this function: |
|
if (m_parent->keys['K']) { if (g_players[g_myPlayerID].extras[PLAY_EXTRAS_FLIPVIEW] > 0) g_players[g_myPlayerID].extras[PLAY_EXTRAS_FLIPVIEW] = 0; else g_players[g_myPlayerID].extras[PLAY_EXTRAS_FLIPVIEW] = 1; m_parent->keys['K'] = false; } if (m_parent->keys['J']) { if (g_players[g_myPlayerID].extras[PLAY_EXTRAS_SHAKE] > 0) g_players[g_myPlayerID].extras[PLAY_EXTRAS_SHAKE] = 0; else g_players[g_myPlayerID].extras[PLAY_EXTRAS_SHAKE] = 1; m_parent->keys['J'] = false; } if (m_parent->keys['H']) { if (g_players[g_myPlayerID].extras[PLAY_EXTRAS_INVISIBLE] > 0) g_players[g_myPlayerID].extras[PLAY_EXTRAS_INVISIBLE] = 0; else g_players[g_myPlayerID].extras[PLAY_EXTRAS_INVISIBLE] = 1; m_parent->keys['H'] = false; } if (m_parent->keys['G']) { if (g_players[g_myPlayerID].extras[PLAY_EXTRAS_IMMORTAL] > 0) g_players[g_myPlayerID].extras[PLAY_EXTRAS_IMMORTAL] = 0; else g_players[g_myPlayerID].extras[PLAY_EXTRAS_IMMORTAL] = 1; m_parent->keys['G'] = false; } if (m_parent->keys['U']) { g_players[g_myPlayerID].extras[PLAY_EXTRAS_FAST] += 1; m_parent->keys['U'] = false; } if (m_parent->keys['I']) { g_players[g_myPlayerID].extras[PLAY_EXTRAS_FAST] -= 1; if (g_players[g_myPlayerID].extras[PLAY_EXTRAS_FAST] < 0) g_players[g_myPlayerID].extras[PLAY_EXTRAS_FAST] = 0; m_parent->keys['I'] = false; } if (m_parent->keys['O']) { g_players[g_myPlayerID].extras[PLAY_EXTRAS_SLOW] += 1; m_parent->keys['O'] = false; } if (m_parent->keys['P']) { g_players[g_myPlayerID].extras[PLAY_EXTRAS_SLOW] -= 1; if (g_players[g_myPlayerID].extras[PLAY_EXTRAS_SLOW] < 0) g_players[g_myPlayerID].extras[PLAY_EXTRAS_SLOW] = 0; m_parent->keys['P'] = false; } Definition at line 491 of file Play.cpp. References SPlayer::angle, SPlayer::dir, fireProjectile(), g_models, g_myPlayerID, g_players, g_time, gne, MilkShape::guns, Application::keys, Scene::m_parent, m_sounds, SPlayer::moveVal, SPlayer::moving, PIdiv180, Sound::play(), PLAY_NET_GAME_OVER, PLAY_SOUND_GUN, PLAYER_MOVING_BACKWARD, PLAYER_MOVING_FORWARD, PLAYER_MOVING_NONE, PLAYER_ROTATION_LEFT, PLAYER_ROTATION_NONE, PLAYER_ROTATION_RIGHT, PLAYER_STATE_USER, SPlayer::pos, SWeapon::power, SWeapon::reload, SPlayer::rotation, Gne::sendAttack(), Gne::setPlayerExtras(), Gne::setPlayerPos(), SWeapon::speed, SPlayer::speed, SPlayer::state, throwGrenade(), SWeapon::type, SPlayer::weapon, WEAPON_GRENADE, Vec3::x, Vec3::y, and Vec3::z. Referenced by update(). Here is the call graph for this function: |
|
strcpy(g_players[0].skin, "robot1.bmp"); strcpy(g_players[1].skin, "robot2.bmp"); strcpy(g_players[2].skin, "robot3.bmp"); strcpy(g_players[3].skin, "robot4.bmp"); strcpy(g_players[4].skin, "robot1.bmp"); strcpy(g_players[5].skin, "robot2.bmp"); strcpy(g_players[6].skin, "robot3.bmp"); strcpy(g_players[7].skin, "robot4.bmp"); strcpy(g_players[8].skin, "robot1.bmp"); strcpy(g_players[9].skin, "robot2.bmp"); strcpy(g_players[10].skin, "robot3.bmp"); strcpy(g_players[11].skin, "robot4.bmp"); strcpy(g_players[12].skin, "robot1.bmp"); strcpy(g_players[13].skin, "robot2.bmp"); strcpy(g_players[14].skin, "robot3.bmp"); strcpy(g_players[15].skin, "robot4.bmp"); Reimplemented from Scene. Definition at line 32 of file Play.cpp. References Console::addEx(), console, g_drawConsole, g_gameInfo, g_myPlayerID, g_players, g_showFPS, GAME_STATE_WAITING, SGameInfo::gameState, gne, Gne::isRunning(), loadObjects(), loadSounds(), loadTextures(), LOG_SUCCESS, m_extras, Scene::m_loaded, Scene::m_parent, PLAY_EXTRAS_NONE, PLAY_EXTRAS_SIMULTANEOUS, PLAYER_STATE_READY, setPlayerCam(), Gne::setPlayerState(), SPlayer::state, and PlayExtras::type. Here is the call graph for this function: |
|
"data\\lvls\\lvl1.lvl" Definition at line 192 of file Play.cpp. References ObjLevel::createVertexBuffer(), SGameInfo::currLvl, g_allModels, g_galaxies, g_gameInfo, g_models, g_players, ObjLevel::load(), Level::load(), m_lvl, m_objects, m_objLevel, Scene::m_parent, PLAY_OBJ_GRENADE, PLAY_OBJ_SPHERE, Application::renderer, and SPLAYER_MAX_PLAYERS. Referenced by load(). Here is the call graph for this function: |
|
Definition at line 233 of file Play.cpp. References Music::load(), Sound::load(), m_music, m_sounds, Music::play(), PLAY_SOUND_DEATH, PLAY_SOUND_DROWN, PLAY_SOUND_EXTRAS_AMMO, PLAY_SOUND_EXTRAS_FAST, PLAY_SOUND_EXTRAS_FLIPVIEW, PLAY_SOUND_EXTRAS_IMMORTAL, PLAY_SOUND_EXTRAS_INVISIBLE, PLAY_SOUND_EXTRAS_LIFE, PLAY_SOUND_EXTRAS_SHAKE, PLAY_SOUND_EXTRAS_SLOW, PLAY_SOUND_GRENADE, PLAY_SOUND_GUN, PLAY_SOUND_GUN_HIT, and PLAY_SOUND_SPAWN. Referenced by load(). Here is the call graph for this function: |
|
if (strcmp(g_players[i].skin, "") != 0) { char str[256] = {0}; sprintf(str, "data\\textures\\skins\\%s", g_players[i].skin); if ((g_players[i].textureID = m_parent->renderer->addTexture(str)) == TEXTURE_NONE) return false; } Definition at line 133 of file Play.cpp. References Renderer::addTexture(), g_allModels, g_players, Scene::m_parent, m_textures, SPlayer::model, PLAY_TEX_EXTRAS_OTHER, PLAY_TEX_GAME_OVER, PLAY_TEX_GRENADE, PLAY_TEX_LIFEBAR_BG, PLAY_TEX_LIFEBAR_FRAME, PLAY_TEX_LIFEBAR_GLOW, PLAY_TEX_MODEL_0, PLAY_TEX_PARTICLE, PLAY_TEX_SHADOW, PLAY_TEX_SKIN, PLAY_TEX_SPAWN_SPHERE, Application::renderer, SPLAYER_MAX_PLAYERS, and TEXTURE_NONE. Referenced by load(). Here is the call graph for this function: |
|
|
Definition at line 1560 of file Play.cpp. References g_time, m_extras, PLAY_EXTRAS_NONE, PLAY_EXTRAS_SIMULTANEOUS, PlayExtras::pos, PlayExtras::time, and PlayExtras::type. Referenced by networkLoop(). |
|
Definition at line 1113 of file Play.cpp. References g_players, PLAYER_STATE_OFFLINE, SPlayer::pos, SPLAYER_MAX_PLAYERS, Vec3::x, and Vec3::z. |
|
Author: Petter Alstermark, petter@alstermark.com Just some server functions (to get overview) Definition at line 12 of file Play_server.cpp. References SPlayer::angle, dealExtras(), g_gameInfo, g_players, g_time, GAME_STATE_WAITING, SGameInfo::gameState, ObjLevel::getSpawnpool(), gne, Gne::isRunning(), Gne::isServer(), m_objLevel, m_timeEnd, SPlayer::moving, PLAY_ACTION_PLAYER_SPAWN, PLAY_ACTION_PLAYER_SPAWNED, PLAY_NET_GAME_OVER, PLAY_NET_START_GAME, PLAYER_MOVING_NONE, PLAYER_ROTATION_NONE, PLAYER_STATE_INVISIBLE, PLAYER_STATE_LOADING, PLAYER_STATE_OFFLINE, PLAYER_STATE_SPAWNING, SPlayer::pos, SPlayer::rotation, Gne::setPlayerAction(), Gne::setPlayerExtras(), Gne::setPlayerPos(), SPlayer::spawnTime, SPLAYER_MAX_PLAYERS, SPlayer::state, Vec3::x, and Vec3::z. Referenced by update(). Here is the call graph for this function: |
|
Definition at line 1279 of file Play.cpp. References m_particleSystems, and ParticleSystem::move(). Here is the call graph for this function: |
|
Definition at line 1339 of file Play.cpp. References Application::camera, g_players, g_time, Scene::m_parent, PLAY_EXTRAS_FLIPVIEW, PLAY_EXTRAS_SHAKE, SPlayer::pos, Camera::setHeading(), Camera::setPitch(), and Camera::setPosition(). Referenced by load(), networkLoop(), and update(). Here is the call graph for this function: |
|
Definition at line 1135 of file Play.cpp. References g_players, g_time, gne, Gne::isRunning(), Gne::isServer(), PLAYER_STATE_INVISIBLE, Gne::setPlayerState(), SPlayer::spawnTime, and SPlayer::state. Here is the call graph for this function: |
|
Definition at line 1262 of file Play.cpp. References ParticleSystem::loadPreset(), m_particleSystems, MAX_PARTICLESYSTEMS, ParticleSystem::move(), and ParticleSystem::start(). Referenced by networkLoop(). Here is the call graph for this function: |
|
Definition at line 944 of file Play.cpp. References Granade::create(), m_granades, MAX_GRANADES, and Granade::setPlayerID(). Referenced by bot(), handleKeys(), and networkLoop(). Here is the call graph for this function: |
|
Reimplemented from Scene. Definition at line 259 of file Play.cpp. References MilkShape::clear(), OpenGLObject::clearVertexBuffer(), Renderer::deleteTexture(), g_models, g_players, LOG_SUCCESS, Scene::m_loaded, m_lvl, m_music, m_objects, m_objLevel, Scene::m_parent, m_sounds, m_textures, PLAY_OBJECTS, PLAY_SOUNDS, PLAY_TEXTURES, Application::renderer, SPLAYER_MAX_PLAYERS, Music::stop(), TEXTURE_NONE, Level::unload(), Music::unload(), and Sound::unload(). Referenced by ~Play(). Here is the call graph for this function: |
|
|
Definition at line 161 of file Play.h. Referenced by createExplosion(), and drawExplosions(). |
|
Definition at line 169 of file Play.h. Referenced by drawExtras(), load(), networkLoop(), newExtras(), and update(). |
|
Definition at line 160 of file Play.h. Referenced by drawGrenades(), and throwGrenade(). |
|
Definition at line 164 of file Play.h. Referenced by drawFrame(), loadObjects(), unload(), and update(). |
|
Definition at line 157 of file Play.h. Referenced by loadSounds(), and unload(). |
|
Definition at line 156 of file Play.h. Referenced by drawGrenades(), drawPlayer(), drawProjectiles(), loadObjects(), Play(), and unload(). |
|
Definition at line 165 of file Play.h. Referenced by bot(), dealExtras(), drawFrame(), drawGrenades(), drawProjectiles(), loadObjects(), Play(), serverLoop(), unload(), and update(). |
|
Definition at line 159 of file Play.h. Referenced by drawParticleSystems(), networkLoop(), setParticleSystemPos(), and startParticleSystem(). |
|
Definition at line 162 of file Play.h. Referenced by drawProjectiles(), and fireProjectile(). |
|
Definition at line 155 of file Play.h. Referenced by drawProjectiles(), grenadeExplode(), handleKeys(), loadSounds(), networkLoop(), and unload(). |
|
Definition at line 154 of file Play.h. Referenced by drawAvatar(), drawExplosions(), drawExtras(), drawFrame(), drawGrenades(), drawLifebar(), drawParticleSystems(), drawPlayer(), drawProjectiles(), drawShadow(), loadTextures(), and unload(). |
|
Definition at line 167 of file Play.h. Referenced by drawFrame(), networkLoop(), serverLoop(), and update(). |
|
Definition at line 166 of file Play.h. Referenced by networkLoop(). |