Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 28, 2016, 4:04:42 PM (9 years ago)
Author:
tgidron
Message:

New Pickups (speed); Level Counter and Crate spawn (not working)

Location:
code/branches/tgidronFS16
Files:
2 added
2 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • code/branches/tgidronFS16/data/levels/Hover.oxw

    r11171 r11177  
    2424MAZE_SIZE = MAZE_NUM_CELLS*MAZE_CELL_SIZE
    2525?>
     26<!--
     27<Template name=mediumdamagehoverpickupRepresentation>
     28    <PickupRepresentation>
     29        <spawner-representation>
     30            <StaticEntity>
     31                <attached>
     32                    <Billboard position="0,0,0" colour="0.95,0.10,0.05" material="Sphere2" scale=0.1 >
     33                        <attached>
     34                            <Billboard position="0,0,0" colour="0.70,0.10,0.10" material="Damage" scale=0.5 />
     35                        </attached>
     36                    </Billboard>
     37                </attached>
     38            </StaticEntity>
     39        </spawner-representation>
     40    </PickupRepresentation>
     41</Template>
     42
     43<Template name=damagehover baseclass=DamageBoostPickup>
     44  <DamageBoostPickup
     45    representation = "mediumdamagehoverpickup"
     46    duration = 10.0
     47    damageMultiplier = 5.0
     48    activationType = "immediate"
     49    durationType = "continuous"
     50  />
     51</Template> -->
     52
     53<Template name=hugespeedpickupRepresentation>
     54    <PickupRepresentation>
     55        <spawner-representation>
     56            <StaticEntity>
     57                <attached>
     58                    <Billboard position="0,0,0" colour="0.99,0.96,0.52" material="Sphere2" scale=0.1>
     59                        <attached>
     60                            <Billboard position="0,0,0" colour="0.98,0.94,0.22" material="3arrowsup" scale=0.7 />
     61                        </attached>
     62                    </Billboard>
     63                </attached>
     64            </StaticEntity>
     65        </spawner-representation>
     66    </PickupRepresentation>
     67</Template>
     68
     69<Template name=hugespeedpickup baseclass=SpeedPickup>
     70  <SpeedPickup
     71    representation = "hugespeedpickup"
     72    duration = 10.0
     73    speedAdd = 0.0
     74    SpeedMultiply = 50.0
     75    activationType = "immediate"
     76    durationType = "continuous"
     77  />
     78</Template>
     79
     80
    2681
    2782<Template name=destroyhoverpickupRepresentation>
     
    45100</Template>
    46101
     102<Template name=obstacle baseclass=Pawn>
     103    <Pawn team=1 health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 4" >
     104        <attached>
     105            <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
     106        </attached>
     107        <collisionShapes>
     108            <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
     109        </collisionShapes>
     110    </Pawn>
     111</Template>
     112
     113
    47114<Level
    48115plugins = hover
     
    72139    />
    73140
     141    <PickupRepresentation
     142      name = "hugespeedpickup"
     143      pickupName = "Huge Speed Boost"
     144      pickupDescription = "Multiplies Speed of the Ship by a huge amount."
     145      spawnerTemplate = "hugespeedpickupRepresentation"
     146      inventoryRepresentation = "HugeSpeed"
     147    />
     148<!--
     149    <PickupRepresentation
     150      name = "damagehover"
     151      pickupName = "Medium Damage Hover Pickup"
     152      pickupDescription = "Multiplies the ship damage with 5."
     153      spawnerTemplate = "mediumdamagehoverpickupRepresentation"
     154      inventoryRepresentation = "MediumDamageHover"
     155    /> -->
     156
    74157    <StaticEntity position="0,0,0" collisionType="static">
    75158      <attached>
     
    78161          cellSize="<?lua print(MAZE_CELL_SIZE)?>"
    79162          cellHeight="<?lua print(MAZE_CELL_HEIGHT)?>"
     163          obstacletemplate=obstacle
    80164          pickuptemplate=destroyhoverpickup
    81165          pickuprepresentationtemplate=destroyhoverpickupRepresentation
     166          pickuptemplatedam=hugespeedpickup
     167          pickuprepresentationtemplatedam=hugespeedpickupRepresentation
    82168        />
    83169        <Model
  • code/branches/tgidronFS16/data/levels/includes/weaponSettingsHover.oxi

    r11171 r11177  
    1717    </Weapon>
    1818    <Weapon>
    19       <EnergyDrink mode=0 munitionpershot=0 delay=0 material="Flares/point_lensflare" muzzleoffset=" 0.8, 1, -18.0" projectileMesh="LaserBeam2.mesh" />
     19      <EnergyDrink mode=0 munitionpershot=0 delay=0 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 0.8, 1, -18.0" projectileMesh="LaserBeam2.mesh" />
    2020    </Weapon>
    2121  </WeaponPack>
  • code/branches/tgidronFS16/data/levels/templates/spaceshipHover.oxt

    r11168 r11177  
    7979   boostfactor    = 2
    8080
    81    speedfront     = 120
     81   speedfront     = 150
    8282   speedback      =  40
    8383   speedleftright =  40
  • code/branches/tgidronFS16/data/overlays/HoverHUD.oxo

    r11171 r11177  
    7676    />
    7777
    78     <FlagsAndLivesHUD
     78    <OverlayText
     79     position  = "0.02, 0.16"
     80     pickpoint = "0.0, 0.0"
     81     font      = "ShareTechMono"
     82     textsize  = 0.04
     83     colour    = "1.0, 1.0, 1.0, 1.0"
     84     align     = "left"
     85     caption   = "Level: "
     86    />
     87
     88    <TFlagsLivesLevelHUD
    7989     position  = "0.14, 0.02"
    8090     pickpoint = "0.0, 0.0"
     
    8393     colour    = "1.0, 1.0, 1.0, 1.0"
    8494     align     = "left"
     95     showFlags = true
    8596     showLives = false
     97     showLevel = false
     98
    8699     />
    87100
    88      <FlagsAndLivesHUD
     101     <TFlagsLivesLevelHUD
    89102     position  = "0.14, 0.04"
    90103     pickpoint = "0.0, 0.0"
     
    93106     colour    = "1.0, 1.0, 1.0, 1.0"
    94107     align     = "left"
     108     showFlags = false
    95109     showLives = true
     110     showLevel = false
    96111
    97112     />
     113
     114     <TFlagsLivesLevelHUD
     115     position  = "0.14, 0.06"
     116     pickpoint = "0.0, 0.0"
     117     font      = "ShareTechMono"
     118     textsize  = 0.04
     119     colour    = "1.0, 1.0, 1.0, 1.0"
     120     align     = "left"
     121     showFlags = false
     122     showLives = false
     123     showLevel = true
     124
     125     />
     126
    98127
    99128  </OverlayGroup>
  • code/branches/tgidronFS16/src/modules/hover/CMakeLists.txt

    r11171 r11177  
    88  FlagHUD.cc
    99  MazeGenerator.cc
    10   FlagsAndLivesHUD.cc
     10  TFlagsLivesLevelHUD.cc
    1111)
    1212
  • code/branches/tgidronFS16/src/modules/hover/Hover.cc

    r11171 r11177  
    121121           
    122122
    123             //Generate 5 PickupSpawners randomly
     123            //Generate 5 PickupSpawners randomly (destroy hover pickup)
    124124            for (int i = 0; i<5; i++)
    125125            {
     
    134134                pickupSpawners_.push_back(pickupSpawner);
    135135            }
    136              //If no lives are left, end game
    137             if(lives <= 0){
    138                 GSLevel::startMainMenu();
    139             }
    140 
    141             orxout() << this->origin_->getPickupTemplate() << endl;
    142             orxout() << this->origin_->getPickupRepresentationTemplate() << endl;
    143         }
    144     }
    145 
    146 
    147     // Rename/delete this function.
    148     void Hover::startLevel()
    149     {
    150         //Generate 5 flags randomly (test only 1 flag)
    151             for ( int i = 0; i < 5; i++ )
    152             {
    153                 HoverFlag* flag = new HoverFlag(origin_->getContext());
    154                 flag->init(rand()%numCells, rand()%numCells, cellSize);
    155                 flags_.push_back(flag);
    156             }
    157 
    158         //Generate 5 PickupSpawners randomly
     136           
     137            //Generate 5 PickupSpawners randomly (damage pickup)
    159138            for (int i = 0; i<5; i++)
    160139            {
     
    162141
    163142                pickupSpawner->setPosition(get3dCoordinates(rand()%numCells, rand()%numCells, 10.0f));
    164                 pickupSpawner->setPickupTemplateName(origin_->getPickupTemplate());
     143                pickupSpawner->setPickupTemplateName(origin_->getPickupTemplateDam());
    165144                pickupSpawner->setMaxSpawnedItems(5);
    166145                pickupSpawner->setRespawnTime(30);
     
    170149            }
    171150
     151            //*****************************************************************************
     152
     153            Pawn* crate = new Pawn(origin_->getContext());
     154
     155            crate->setPosition(get3dCoordinates(rand()%numCells, rand()%numCells, 10.0f));
     156            crate->addTemplate(origin_->getObstacleTemplate());
     157
     158
     159
     160
     161             //If no lives are left, end game
     162            if(lives <= 0){
     163                GSLevel::startMainMenu();
     164            }
     165
     166            orxout() << this->origin_->getPickupTemplate() << endl;
     167            orxout() << this->origin_->getPickupRepresentationTemplate() << endl;
     168
     169            orxout() << this->origin_->getPickupTemplateDam() << endl;
     170            orxout() << this->origin_->getPickupRepresentationTemplateDam() << endl;
     171        }
     172    }
     173
     174
     175    // Start new level
     176    void Hover::newLevel()
     177    {
     178        //Generate 5 flags randomly (test only 1 flag)
     179            for ( int i = 0; i < 5; i++ )
     180            {
     181                HoverFlag* flag = new HoverFlag(origin_->getContext());
     182                flag->init(rand()%numCells, rand()%numCells, cellSize);
     183                flags_.push_back(flag);
     184            }
    172185           
    173186    }
     
    187200                totFlags++;
    188201                if(flags_.size()<=0){
    189                     ChatManager::message("Level Up!");
     202                    //ChatManager::message("Level Up!");
    190203                   
    191204                    levelUp();
     
    205218    {
    206219        level++;
    207         startLevel();
     220        //increment lives after every 4 levels
     221        if(level%4 == 0)
     222        {
     223            lives++;
     224        }
     225        newLevel();
    208226
    209227    }
  • code/branches/tgidronFS16/src/modules/hover/Hover.h

    r11171 r11177  
    5858
    5959            void start();
    60             void startLevel();
     60            void newLevel();
    6161            void levelUp();
    6262            void endLevel();
     
    7373            inline int getLives() const
    7474                { return this->lives; }
     75
     76            inline int getLevel() const
     77                { return this->level; }
    7578
    7679        private:
  • code/branches/tgidronFS16/src/modules/hover/HoverOrigin.cc

    r11169 r11177  
    4848        pickupTemplate_ = "";
    4949        pickupRepresentationTemplate_ = "";
     50
     51        pickupTemplateDam_ = "";
     52        pickupRepresentationTemplateDam_ = "";
    5053    }
    5154
     
    5962        XMLPortParam(HoverOrigin, "pickuptemplate", setPickupTemplate, getPickupTemplate, xmlelement, mode);
    6063        XMLPortParam(HoverOrigin, "pickuprepresentationtemplate", setPickupRepresentationTemplate, getPickupRepresentationTemplate, xmlelement, mode);
     64        XMLPortParam(HoverOrigin, "pickuptemplatedam", setPickupTemplateDam, getPickupTemplateDam, xmlelement, mode);
     65        XMLPortParam(HoverOrigin, "pickuprepresentationtemplatedam", setPickupRepresentationTemplateDam, getPickupRepresentationTemplateDam, xmlelement, mode);
     66        XMLPortParam(HoverOrigin, "obstacletemplate", setObstacleTemplate, getObstacleTemplate, xmlelement, mode);
    6167    }
     68
    6269
    6370    void HoverOrigin::checkGametype()
  • code/branches/tgidronFS16/src/modules/hover/HoverOrigin.h

    r11169 r11177  
    6666                { return this->cellHeight_; }
    6767
     68            //pickup template set and get for destroy hover pickup
     69
    6870            inline void setPickupTemplate(std::string pickupTemplate)
    6971                { this->pickupTemplate_ = pickupTemplate; }
     
    7678                { return this->pickupRepresentationTemplate_; }
    7779
     80            //pickup template get and set for damage hover pickup
     81
     82            inline void setPickupTemplateDam(std::string pickupTemplateDam)
     83                { this->pickupTemplateDam_ = pickupTemplateDam; }
     84            inline std::string getPickupTemplateDam() const
     85                { return this->pickupTemplateDam_; }
     86
     87            inline void setPickupRepresentationTemplateDam(std::string pickupRepresenationaTemplateDam)
     88                { this->pickupRepresentationTemplateDam_ = pickupRepresenationaTemplateDam; }
     89            inline std::string getPickupRepresentationTemplateDam() const
     90                { return this->pickupRepresentationTemplateDam_; }
     91
     92            //get and set for obstacle template
     93
     94            inline void setObstacleTemplate(std::string obstacleTemplate)
     95                { this->obstacleTemplate_ = obstacleTemplate; }
     96            inline std::string getObstacleTemplate() const
     97                { return this->obstacleTemplate_; }       
     98
    7899        private:
    79100            void checkGametype();
     101
    80102       
    81103            int numCells_;
     
    86108            std::string pickupTemplate_;
    87109            std::string pickupRepresentationTemplate_;
     110
     111            // Tempaltes for the damage hover pickup
     112            std::string pickupTemplateDam_;
     113            std::string pickupRepresentationTemplateDam_;
     114
     115            //Template for crate obstacle
     116            std::string obstacleTemplate_;
    88117    };
    89118}
Note: See TracChangeset for help on using the changeset viewer.