Changeset 6306 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Dec 26, 2005, 2:27:13 PM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/space_ships/space_ship.cc
r6300 r6306 39 39 40 40 41 #include "lib/gui/gl_gui/glgui_bar.h"42 #include "lib/gui/gl_gui/glgui_pushbutton.h"41 // #include "lib/gui/gl_gui/glgui_bar.h" 42 // #include "lib/gui/gl_gui/glgui_pushbutton.h" 43 43 44 44 … … 121 121 PRINTF(4)("SPACESHIP INIT\n"); 122 122 123 //EventHandler::getInstance()->grabEvents(true);123 EventHandler::getInstance()->grabEvents(true); 124 124 125 125 bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false; … … 135 135 this->mouseDir = this->getAbsDir(); 136 136 137 GLGuiButton* button = new GLGuiPushButton();138 button->show();139 button->setLabel("orxonox");140 button->setBindNode(this);141 GLGuiBar* bar = new GLGuiBar();142 bar->show();143 bar->setValue(7.0);144 bar->setMaximum(10);145 bar->setSize2D( 20, 100);146 bar->setAbsCoor2D( 10, 200);137 // GLGuiButton* button = new GLGuiPushButton(); 138 // button->show(); 139 // button->setLabel("orxonox"); 140 // button->setBindNode(this); 141 // GLGuiBar* bar = new GLGuiBar(); 142 // bar->show(); 143 // bar->setValue(7.0); 144 // bar->setMaximum(10); 145 // bar->setSize2D( 20, 100); 146 // bar->setAbsCoor2D( 10, 200); 147 147 148 148 //add events to the eventlist … … 490 490 Weapon* turret = NULL; 491 491 492 if ((float)rand()/RAND_MAX < . 1)492 if ((float)rand()/RAND_MAX < .9) 493 493 { 494 494 //if (this->getWeaponManager()->hasFreeSlot(2, WTYPE_TURRET)) -
trunk/src/world_entities/weapons/turret.cc
r6222 r6306 82 82 83 83 this->setStateDuration(WS_SHOOTING, .1); 84 this->setStateDuration(WS_RELOADING, .1);84 this->setStateDuration(WS_RELOADING, 1.0f); 85 85 this->setStateDuration(WS_ACTIVATING, .4); 86 86 this->setStateDuration(WS_DEACTIVATING, .4); 87 87 88 this->setMaximumEnergy(100 00, 50);89 this->increaseEnergy(100 000);88 this->setMaximumEnergy(100, 5); 89 this->increaseEnergy(100); 90 90 //this->minCharge = 2; 91 91 … … 96 96 this->setEmissionPoint(1.684, 0.472, 0); 97 97 //this->getProjectileFactory()->prepare(100); 98 99 this->bar = new GLGuiBar; 100 this->bar->setSize2D( 20, 100); 101 this->bar->setMaximum(this->getEnergyMax()); 102 this->bar->setValue(this->getEnergy()); 103 this->loadedBar = new GLGuiBar; 104 this->loadedBar->setParent2D(this->bar); 105 this->loadedBar->setRelCoor2D(20,0); 106 this->loadedBar->setSize2D(10,50); 107 this->loadedBar->setMaximum(this->getLoadedEnergyMax()); 98 108 } 99 109 … … 106 116 void Turret::activate() 107 117 { 118 this->bar->show(); 119 this->loadedBar->show(); 108 120 } 109 121 110 122 void Turret::deactivate() 111 123 { 124 this->bar->hide(); 125 this->loadedBar->hide(); 112 126 } 113 127 … … 141 155 pj->setAbsDir(this->getAbsDir()); 142 156 pj->activate(); 157 158 this->bar->setValue( this->getEnergy()); 159 this->loadedBar->setValue(this->getLoadedEnergy()); 143 160 } 144 161 -
trunk/src/world_entities/weapons/turret.h
r5994 r6306 8 8 9 9 #include "weapon.h" 10 11 #include "glgui_bar.h" 10 12 11 13 class Turret : public Weapon … … 28 30 29 31 private: 32 GLGuiBar* bar; 33 GLGuiBar* loadedBar; 30 34 }; 31 35 -
trunk/src/world_entities/weapons/weapon.cc
r6142 r6306 438 438 this->soundSource->play(this->soundBuffers[WA_SHOOT]); 439 439 // fire 440 this->energyLoaded -= this->minCharge; 440 441 this->fire(); 441 this->energyLoaded -= this->minCharge;442 442 // setting up for the next state 443 443 this->enterState(WS_SHOOTING); -
trunk/src/world_entities/weapons/weapon.h
r6054 r6306 136 136 /** @param energyMax the maximum energy the Weapon can have @param energyLoadedMax the maximum energy in the weapon buffers */ 137 137 inline void setMaximumEnergy(float energyMax, float energyLoadedMax) { this->energyMax = energyMax; this->energyLoadedMax = energyLoadedMax; }; 138 inline float getLoadedEnergyMax() const { return this->energyLoadedMax; }; 139 inline float getEnergyMax() const { return this->energyMax; }; 140 inline float getEnergy() const { return this->energy; }; 141 inline float getLoadedEnergy() const { return this->energyLoaded; }; 138 142 139 143 void setActionSound(WeaponAction action, const char* soundFile);
Note: See TracChangeset
for help on using the changeset viewer.