Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11495


Ignore:
Timestamp:
Oct 23, 2017, 12:23:21 AM (7 years ago)
Author:
patricwi
Message:

reverted commit from merge with tgidronFS16 because failed to compile

Location:
code/trunk
Files:
2 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/data/levels/Hover.oxw

    r11493 r11495  
    33 description = "Level for Minigame Hover"
    44 tags = "minigame"
    5  screenshot = "hover.png"
     5 screenshot = "emptylevel.png"
    66/>
    77
     
    2020<?lua
    2121MAZE_NUM_CELLS = 10
    22 MAZE_CELL_SIZE = 600
    23 MAZE_CELL_HEIGHT = 180
    24 MAZE_WALL_THICKNESS = 10
     22MAZE_CELL_SIZE = 100
     23MAZE_CELL_HEIGHT = 30
    2524MAZE_SIZE = MAZE_NUM_CELLS*MAZE_CELL_SIZE
    2625?>
    27 
    28 <!-- Shrink Pickup Representation -->
    29 
    30 <Template name=smallshrinkpickupRepresentation>
    31     <PickupRepresentation>
    32         <spawner-representation>
    33             <StaticEntity>
    34                 <attached>
    35                     <Billboard position="0,0,0" colour="1.0,0.55,1.0" material="Sphere2" scale=0.5>
    36                         <attached>
    37                             <Billboard position="0,0,0" colour="1.0,0.55,1.0" material="Shrink" scale=0.35 />
    38                         </attached>
    39                     </Billboard>
    40                 </attached>
    41             </StaticEntity>
    42         </spawner-representation>
    43     </PickupRepresentation>
    44 </Template>
    45 
    46 
    47 <Template name=smallshrinkpickup baseclass=ShrinkPickup>
    48   <ShrinkPickup
    49     representation = "smallshrinkpickup"
    50     duration = 10.0
    51     shrinkFactor = 2
    52     activaionType = "immediate"
    53     durationType = "continuous"
    54   />
    55 </Template>
    56 
    57 <!-- Speed Pickup Representation -->
    58 
    59 <Template name=hugespeedpickupRepresentation>
    60     <PickupRepresentation>
    61         <spawner-representation>
    62             <StaticEntity>
    63                 <attached>
    64                     <Billboard position="0,0,0" colour="0.99,0.96,0.52" material="Sphere2" scale=0.5>
    65                         <attached>
    66                             <Billboard position="0,0,0" colour="0.98,0.94,0.22" material="3arrowsup" scale=0.7 />
    67                         </attached>
    68                     </Billboard>
    69                 </attached>
    70             </StaticEntity>
    71         </spawner-representation>
    72     </PickupRepresentation>
    73 </Template>
    74 
    75 <Template name=hugespeedpickup baseclass=SpeedPickup>
    76   <SpeedPickup
    77     representation = "hugespeedpickup"
    78     duration = 10.0
    79     speedAdd = 0.0
    80     SpeedMultiply = 5.0
    81     activationType = "immediate"
    82     durationType = "continuous"
    83   />
    84 </Template>
    85 
    86 <!-- Destroy Carrier Pickup Representation -->
    87 
    88 <Template name=destroyhoverpickupRepresentation>
    89     <PickupRepresentation>
    90         <spawner-representation>
    91             <StaticEntity>
    92                 <attached>
    93                     <Billboard position="0,0,0" colour="0.6,0.⁰,0.8" material="Sphere2" scale=0.5>
    94                         <attached>
    95                             <Billboard position="0,0,0" colour="0.6,0.⁰,0.8" material="Asterisk" scale=0.65 />
    96                         </attached>
    97                     </Billboard>
    98                 </attached>
    99             </StaticEntity>
    100         </spawner-representation>
    101     </PickupRepresentation>
    102 </Template>
    103 
    104 <Template name=destroyhoverpickup baseclass=MetaPickup>
    105   <MetaPickup representation="destroyhover" metaType="destroyCarrier" />
    106 </Template>
    107 
    108 <!-- Obstacle (crate) Template -->
    109 
    110 <Template name=obstacle baseclass=Pawn>
    111     <Pawn team=1 health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=10000000000000 name=box RVName = "Box 4" >
    112         <attached>
    113             <Model position="0,0,0" mesh="crate.mesh" scale3D="15,15,15" />
    114         </attached>
    115         <collisionShapes>
    116             <BoxCollisionShape position="0,0,0" halfExtents="70,70,70" />
    117         </collisionShapes>
    118     </Pawn>
    119 </Template>
    120 
    121 <!-- Ground Template -->
    122 
    123 <Template name=ground baseclass=StaticEntity>
    124     <StaticEntity position="0,0,0" direction="0,0,0" collisionType=static mass=100000000 friction=0.01 >
    125       <attached>
    126         <Model position="0,0,0" mesh="CubeGround.mesh" scale3D="300,20,300" />
    127       </attached>
    128       <collisionShapes>
    129         <BoxCollisionShape position="0,0,0" halfExtents="300,10,300" />
    130       </collisionShapes>
    131     </StaticEntity>
    132 </Template>
    13326
    13427<Level
     
    13932    <Template link=lodtemplate_default />
    14033  </templates>
    141 
    14234  <?lua include("includes/notifications.oxi") ?>
    14335
     
    14537    ambientlight = "0.8, 0.8, 0.8"
    14638    skybox       = "Orxonox/Starbox"
    147     gravity      = "0, -300, 0"
     39    gravity      = "0, -200, 0"
    14840  >
    149 
    150     <PickupRepresentation
    151       name = "destroyhover"
    152       pickupName = "Destroy Hover Pickup"
    153       pickupDescription = "destroys you."
    154       spawnerTemplate = "destroyhoverpickupRepresentation"
    155       inventoryRepresentation = "destroyHoverPickup"
    156     />
    157 
    158     <PickupRepresentation
    159       name = "hugespeedpickup"
    160       pickupName = "Huge Speed Boost"
    161       pickupDescription = "Multiplies Speed of the Ship by a huge amount."
    162       spawnerTemplate = "hugespeedpickupRepresentation"
    163       inventoryRepresentation = "HugeSpeed"
    164     />
    165 
    166     <PickupRepresentation
    167       name = "smallshrinkpickup"
    168       pickupName = "Small Shrink"
    169       pickupDescription = "Shrinks the ship by a small amount."
    170       spawnerTemplate = "smallshrinkpickupRepresentation"
    171       inventoryRepresentation = "SmallShrink"
    172     />
    17341
    17442    <StaticEntity position="0,0,0" collisionType="static">
     
    17846          cellSize="<?lua print(MAZE_CELL_SIZE)?>"
    17947          cellHeight="<?lua print(MAZE_CELL_HEIGHT)?>"
    180           wallThickness="<?lua print(MAZE_WALL_THICKNESS)?>"
    181           obstacletemplate=obstacle
    182           pickuptemplate=destroyhoverpickup
    183           pickuprepresentationtemplate=destroyhoverpickupRepresentation
    184           pickuptemplatespeed=hugespeedpickup
    185           pickuprepresentationtemplatespeed=hugespeedpickupRepresentation
    186           pickuptemplateshrink=smallshrinkpickup
    187           pickuprepresentationtemplateshrink=smallshrinkpickupRepresentation
    188           groundtemplate=ground
    18948        />
    190 
     49        <Model
     50          position="<?lua print(MAZE_SIZE/2)?>,-16,<?lua print(MAZE_SIZE/2)?>"
     51          scale3D="<?lua print(MAZE_SIZE/2)?>,16,<?lua print(MAZE_SIZE/2)?>"
     52          mesh="CubeGround.mesh"
     53        />
    19154      </attached>
    192      
     55      <collisionShapes>
     56        <BoxCollisionShape
     57          position="<?lua print(MAZE_SIZE/2)?>,<?lua print(MAZE_CELL_HEIGHT+1)?>,<?lua print(MAZE_SIZE/2)?>"
     58          halfExtents="<?lua print(MAZE_SIZE/2)?>,1,<?lua print(MAZE_SIZE/2)?>"
     59        />
     60        <BoxCollisionShape
     61          position="<?lua print(MAZE_SIZE/2)?>,-1,<?lua print(MAZE_SIZE/2)?>"
     62          halfExtents="<?lua print(MAZE_SIZE/2)?>,1,<?lua print(MAZE_SIZE/2)?>"
     63        />
     64      </collisionShapes>
    19365    </StaticEntity>
    19466
     
    20375    <SpawnPoint
    20476      team=0
    205       position="300,120,300"
    206       lookat="600,120,600"
     77      position="50,20,50"
     78      lookat="100,20,100"
    20779      spawnclass=HoverShip
    20880      pawndesign=spaceshiphover
     
    21183  </Scene>
    21284</Level>
     85
  • code/trunk/data/levels/includes/weaponSettingsHover.oxi

    r11493 r11495  
    11<weaponslots>
    2   <WeaponSlot position="-10,2,-100" />
    3   <WeaponSlot position=" 10,2,-100" />
     2  <WeaponSlot position="-3,2,-3" />
     3  <WeaponSlot position=" 3,2,-3" />
    44</weaponslots>
    55<weaponsets>
     
    1414    </links>
    1515    <Weapon>
    16       <HsW01 mode=0 munitionpershot=0 delay=0.125 speed=2000.0f damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 1, 1,-50 " projectileMesh="LaserBeam2.mesh" />
     16      <IceGun mode=0 munitionpershot=0 delay=0.125 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" projectileMesh="LaserBeam2.mesh" />
    1717    </Weapon>
    1818    <Weapon>
    19       <HsW01 mode=0 munitionpershot=0 delay=0.125 speed=2000.0f damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 0.8, 1,-50" projectileMesh="LaserBeam2.mesh" />
     19      <IceGun mode=0 munitionpershot=0 delay=0     damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" projectileMesh="LaserBeam2.mesh" />
    2020    </Weapon>
    2121  </WeaponPack>
     
    2727</weaponpacks> 
    2828<munition>
    29   <LaserMunition initialmagazines=2 maxmagazines=2 munitionpermagazine=20/>
     29  <IceMunition initialmagazines=1 maxmagazines=1 munitionpermagazine=10/>
    3030</munition>
  • code/trunk/data/levels/templates/spaceshipHover.oxt

    r11493 r11495  
    1818   reloadwaittime      = 0.5
    1919
    20    primaryThrust     = 2000
    21    auxilaryThrust    = 1
    22    rotationThrust    = 45
     20   primaryThrust     = 200
     21   auxilaryThrust    = 30
     22   rotationThrust    = 25
    2323
    24    jumpBoost = 350
     24   jumpBoost = 90
    2525
    2626   lift = 1;
    27    stallSpeed = 1400;
     27   stallSpeed = 220;
    2828
    2929   boostPower            = 10
     
    3333
    3434   collisionType     = "dynamic"
    35    mass              = 1000000
     35   mass              = 100
    3636   linearDamping     = 0.2
    3737   angularDamping    = 0.9999999
     
    4141    </engines>
    4242    <attached>
    43       <Model position="0,0,-120" mesh="hovership_body.mesh" scale="30" yaw=180/>       
    44       <Model position="0,0,-120" mesh="hovership_engine.mesh" scale="30" yaw=180/>     
    45       <Model position="0,0,-120" mesh="hovership_gun.mesh" scale="30" yaw=180/>
     43      <Model position="0,0,-20" mesh="hovership_body.mesh" scale="5" yaw=180/> 
     44      <Model position="0,0,-20" mesh="hovership_engine.mesh" scale="5" yaw=180/>       
     45      <Model position="0,0,-20" mesh="hovership_gun.mesh" scale="5" yaw=180/>   
    4646     
    4747    </attached>
    4848    <collisionShapes>
    49       <BoxCollisionShape position="0,-12, 42" halfExtents="49, 24 ,180" />
     49      <BoxCollisionShape position="0,-2 ,7" halfExtents="7, 4 ,30" />
    5050    </collisionShapes>
    5151    <explosion>
    5252      <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
    53       <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" scale=12 />
     53      <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" scale=2 />
    5454      <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
    5555
     
    6969  <SpaceShip>
    7070    <camerapositions>
    71       <CameraPosition position="0, 48, 30" drag=true mouselook=true />
    72       <CameraPosition position="0, 48, 30" yaw="180" drag=true mouselook=true />
     71      <CameraPosition position="0,8, 5" drag=true mouselook=true />
     72      <CameraPosition position="0,8,5" yaw="180" drag=true mouselook=true />
    7373    </camerapositions>
    7474  </SpaceShip>
     
    7979   boostfactor    = 2
    8080
    81    speedfront     = 1400
    82    speedback      =  800
    83    speedleftright =  700
    84    speedupdown    =  700
     81   speedfront     = 90
     82   speedback      =  40
     83   speedleftright =  40
     84   speedupdown    =  40
    8585
    86    accelerationfront     = 1000
    87    accelerationbrake     = 1000
    88    accelerationback      =  250
    89    accelerationleftright =  350
     86   accelerationfront     = 500
     87   accelerationbrake     = 500
     88   accelerationback      =  125
     89   accelerationleftright =  125
    9090   accelerationupdown    =  125
    9191  >
  • code/trunk/data/overlays/HoverHUD.oxo

    r11493 r11495  
    3939     iconmaterial      = "Orxonox/BarIconHealth"
    4040    >
    41 
    4241      <BarColour position = 0.0 colour = "0.7,0.2,0.2" />
    4342      <BarColour position = 0.5 colour = "0.7,0.7,0.2" />
    4443      <BarColour position = 1.0 colour = "0.2,0.7,0.2" />
    4544    </HUDHealthBar>
    46 
    47 
    48 
    49     <OverlayText
    50      position  = "0.02, 0.08"
    51      pickpoint = "0.0, 0.0"
    52      font      = "ShareTechMono"
    53      textsize  = 0.04
    54      colour    = "1.0, 1.0, 1.0, 1.0"
    55      align     = "left"
    56      caption   = "Total Flags: "
    57     />
    58 
    59     <OverlayText
    60      position  = "0.02, 0.12"
    61      pickpoint = "0.0, 0.0"
    62      font      = "ShareTechMono"
    63      textsize  = 0.04
    64      colour    = "1.0, 1.0, 1.0, 1.0"
    65      align     = "left"
    66      caption   = "Lives: "
    67     />
    68 
    69     <OverlayText
    70      position  = "0.02, 0.16"
    71      pickpoint = "0.0, 0.0"
    72      font      = "ShareTechMono"
    73      textsize  = 0.04
    74      colour    = "1.0, 1.0, 1.0, 1.0"
    75      align     = "left"
    76      caption   = "Level: "
    77     />
    78 
    79     <TFlagsLivesLevelHUD
    80      position  = "0.14, 0.02"
    81      pickpoint = "0.0, 0.0"
    82      font      = "ShareTechMono"
    83      textsize  = 0.04
    84      colour    = "1.0, 1.0, 1.0, 1.0"
    85      align     = "left"
    86      showFlags = true
    87      showLives = false
    88      showLevel = false
    89      levelUpgrade = false
    90 
    91      />
    92 
    93      <TFlagsLivesLevelHUD
    94      position  = "0.14, 0.04"
    95      pickpoint = "0.0, 0.0"
    96      font      = "ShareTechMono"
    97      textsize  = 0.04
    98      colour    = "1.0, 1.0, 1.0, 1.0"
    99      align     = "left"
    100      showFlags = false
    101      showLives = true
    102      showLevel = false
    103      levelUpgrade = false
    104 
    105      />
    106 
    107      <TFlagsLivesLevelHUD
    108      position  = "0.14, 0.06"
    109      pickpoint = "0.0, 0.0"
    110      font      = "ShareTechMono"
    111      textsize  = 0.04
    112      colour    = "1.0, 1.0, 1.0, 1.0"
    113      align     = "left"
    114      showFlags = false
    115      showLives = false
    116      showLevel = true
    117      levelUpgrade = false
    118 
    119      />
    120 
    121      <TFlagsLivesLevelHUD
    122      position  = "0.3, 0.45"
    123      pickpoint = "0.0, 0.0"
    124      font      = "ShareTechMono"
    125      textsize  = 0.04
    126      colour    = "1.0, 1.0, 1.0, 1.0"
    127      align     = "left"
    128      showFlags = false
    129      showLives = false
    130      showLevel = false
    131      levelUpgrade = true
    132 
    133      />
    134 
    135 
    136   </OverlayGroup>
    137 
     45 </OverlayGroup>
    13846</Template>
    139 
    140 
    141  
    142 
  • code/trunk/src/modules/hover/CMakeLists.txt

    r11493 r11495  
    88  FlagHUD.cc
    99  MazeGenerator.cc
    10   TFlagsLivesLevelHUD.cc
    1110)
    1211
     
    1817    objects
    1918    overlays
    20     pickup
    2119  SOURCE_FILES ${Hover_SRC_FILES}
    2220)
  • code/trunk/src/modules/hover/Hover.cc

    r11493 r11495  
    2424 *   Co-authors:
    2525 *      Cyrill Burgener
    26  *      Tomer Gidron
    2726 *
    2827 */
     
    3433
    3534#include "Hover.h"
    36 #include "chat/ChatManager.h"
     35
    3736#include "HoverOrigin.h"
    3837#include "HoverWall.h"
     
    4039#include "MazeGenerator.h"
    4140#include "core/CoreIncludes.h"
    42 #include "gamestates/GSLevel.h"
    43 #include "HoverShip.h"
    44 
    45 #include "pickup/PickupSpawner.h"
    46 #include "pickup/Pickup.h"
    4741
    4842namespace orxonox
     
    5751        this->numberOfFlags_ = 1;
    5852        this->firstTick_ = true;
    59         level = 1; //start at level 1
    60         flagsTaken = 0;// took 0 flags in the beginning
    61         lives = 3;
    62 
    63         numCells = 0;
    64         cellSize = 0;
    65         cellHeight = 0;
    66 
    67         bLevelUpgradeHUD = false;
    68 
    69         totFlags = 0;
    7053
    7154        this->setHUDTemplate("HoverHUD");
    72 
    7355    }
    7456
    75     void Hover::start()
     57    void Hover::tick(float dt)
    7658    {
    77         Gametype::start();
     59        SUPER(Hover, tick, dt);
     60
    7861        if(this->firstTick_ && this->origin_)
    7962        {
    8063            this->firstTick_ = false;
    8164
    82             numCells = this->origin_->getNumCells();
    83             cellSize = this->origin_->getCellSize();
    84             cellHeight = this->origin_->getCellHeight();
    85 
    86             //TODO
    87             //create boolean array/vector to assert that no two objects are placed in the same way
    88            
     65            int numCells = this->origin_->getNumCells();
     66            int cellSize = this->origin_->getCellSize();
     67            int cellHeight = this->origin_->getCellHeight();
    8968
    9069            MazeGenerator generator(numCells);
     
    10281            }
    10382
    104 
    105             //Ground
    106             for(int i = 0; i<numCells; i++){
    107                 for(int j = 0; j<numCells; j++){
    108                     StaticEntity* groundCell = new StaticEntity(origin_->getContext());
    109 
    110                     groundCell->addTemplate(origin_->getGroundTemplate());
    111                     groundCell->setPosition(get3dCoordinates(i,j,-60));
    112                 }
    113 
    114             }
    115 
    116 
    117 
    11883            //Generate inner Walls according to levelcode
    11984            for(int y=0; y<numCells; y++){
    12085                for(int x=0; x<numCells; x++){
    121                     switch(levelcode[ y * numCells + x ])
    122                     {
     86                    switch(levelcode[ y * numCells + x ]){
    12387                        case 1: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 1);
    124                             break;
     88                                break;
    12589                        case 3: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 1);
    12690                        case 2: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 0);
    127                         default:
    128                             break;
     91                        default: break;
    12992                    }
    130                 }
     93                }   
    13194            }
    13295
    133             createFlags();
    134 
    135             //Generate 3 PickupSpawners randomly (destroy hover pickup)
    136             for (int i = 0; i<3; i++)
     96            //Generate 5 flags randomly
     97            for ( int i = 0; i < 5; i++ )
    13798            {
    138                 PickupSpawner* pickupSpawner = new PickupSpawner(origin_->getContext());
    139 
    140                 pickupSpawner->setPosition(get3dCoordinates(rand()%numCells, rand()%numCells, 0.0f));
    141                 pickupSpawner->setPickupTemplateName(origin_->getPickupTemplate());
    142                 pickupSpawner->setMaxSpawnedItems(3);
    143                 pickupSpawner->setRespawnTime(30);
    144                 pickupSpawner->setTriggerDistance(40);
    145                 // Add pickup spawner to the pickup spawner list
    146                 pickupSpawners_.push_back(pickupSpawner);
    147             }
    148            
    149             //Generate 3 PickupSpawners randomly (speed pickup)
    150             for (int i = 0; i<3; i++)
    151             {
    152                 PickupSpawner* pickupSpawner = new PickupSpawner(origin_->getContext());
    153 
    154                 pickupSpawner->setPosition(get3dCoordinates(rand()%numCells, rand()%numCells, 0.0f));
    155                 pickupSpawner->setPickupTemplateName(origin_->getPickupTemplateSpeed());
    156                 pickupSpawner->setMaxSpawnedItems(3);
    157                 pickupSpawner->setRespawnTime(30);
    158                 pickupSpawner->setTriggerDistance(40);
    159                 // Add pickup spawner to the pickup spawner list
    160                 pickupSpawners_.push_back(pickupSpawner);
     99                HoverFlag* flag = new HoverFlag(origin_->getContext());
     100                flag->init(rand()%numCells, rand()%numCells, cellSize);
     101                flags_.push_back(flag);
    161102            }
    162103
    163             //Generate 3 PickupSpawners randomly (shrink pickup)
    164             for (int i = 0; i<3; i++)
    165             {
    166                 PickupSpawner* pickupSpawner = new PickupSpawner(origin_->getContext());
     104        }//firsttick end
    167105
    168                 pickupSpawner->setPosition(get3dCoordinates(rand()%numCells, rand()%numCells, 0.0f));
    169                 pickupSpawner->setPickupTemplateName(origin_->getPickupTemplateShrink());
    170                 pickupSpawner->setMaxSpawnedItems(3);
    171                 pickupSpawner->setRespawnTime(30);
    172                 pickupSpawner->setTriggerDistance(40);
    173                 // Add pickup spawner to the pickup spawner list
    174                 pickupSpawners_.push_back(pickupSpawner);
    175             }
    176 
    177             //*****************************************************************************
    178 
    179             //Generate destroyable crates randomly on field
    180 
    181             for (int i = 0; i<10; i++){
    182 
    183                 Pawn* crate = new Pawn(origin_->getContext());
    184 
    185                 crate->addTemplate(origin_->getObstacleTemplate()); 
    186                 crate->setPosition(get3dCoordinates(rand()%numCells, rand()%numCells, 43.0f));
    187 
    188 
    189             }   
    190            
    191 
    192 
    193 
    194              //If no lives are left, end game
    195             if(lives <= 0)
    196             {
    197                 GSLevel::startMainMenu();
    198             }
    199            
    200         }
    201     }
    202 
    203 
    204     // generate new Flags
    205     void Hover::createFlags()
    206     {
    207         //TODO
    208         //Generate flags randomly using bool array
    209 
    210         //Generate 5 flags randomly on field
    211         for ( int i = 0; i < 5; i++ )
    212         {
    213             HoverFlag* flag = new HoverFlag(origin_->getContext());
    214             flag->init(rand()%numCells, rand()%numCells, cellSize);
    215             flags_.push_back(flag);
    216 
    217            
    218 
    219             if(flags_[i]->getPosition() == get3dCoordinates(0,0,-60))
    220             {
     106        // Check if ship collided with one of the flags
     107        for ( unsigned int i = 0; i < flags_.size(); i++ ){
     108            if(flags_[i]->getCollided()){
    221109                flags_[i]->destroyLater();
    222                 flags_.erase(flags_.begin()+i);
     110                flags_.erase (flags_.begin()+i);
    223111            }
    224112        }
    225            
    226     }
    227 
    228     void Hover::tick(float dt)
    229     {
    230         SUPER(Hover, tick, dt);
    231 
    232 
    233         // Check if ship collided with one of the flags
    234         for ( unsigned int i = 0; i < flags_.size(); i++ )
    235         {
    236             if(flags_[i]->getCollided())
    237             {
    238                 flags_[i]->destroyLater();
    239                 flags_.erase (flags_.begin()+i);
    240                 totFlags++;
    241                 if(flags_.size()<=0){
    242                     //ChatManager::message("Level Up!");
    243                    
    244                     levelUp();
    245                 }
    246             }
    247 
    248         }
    249113        numberOfFlags_ = flags_.size();
    250 
    251         if(lives <= 0){
    252                 GSLevel::startMainMenu();
    253             }
    254     }
    255 
    256     //start new level - call to create new flags
    257     void Hover::levelUp()
    258     {
    259         level++;
    260         //increment lives after every 4 levels
    261         if(level%4 == 0)
    262         {
    263             lives++;
    264         }
    265         createFlags();
    266         toggleShowLevel();
    267         showLevelTimer.setTimer(2.0f, false, createExecutor(createFunctor(&Hover::toggleShowLevel, this)));
    268 
    269         //spawn one additional crate randomly
    270         Pawn* crate = new Pawn(origin_->getContext());
    271         crate->addTemplate(origin_->getObstacleTemplate()); 
    272         crate->setPosition(get3dCoordinates(rand()%numCells, rand()%numCells, 43.0f));
    273 
    274     }
    275 
    276     Vector3 Hover::get3dCoordinates(int x, int y, float heightOffset)
    277     {
    278         return Vector3(x*cellSize*1.0f + cellSize/2, heightOffset, y*cellSize*1.0f + cellSize/2);
    279     }
    280 
    281     //if killed, subtract number of lives. If lives == 0, end game
    282     void Hover::costLife()
    283     {
    284         lives--;
    285         if (lives <= 0)
    286             GSLevel::startMainMenu();
    287114    }
    288115}
  • code/trunk/src/modules/hover/Hover.h

    r11493 r11495  
    2424 *   Co-authors:
    2525 *      Cyrill Burgener
    26  *      Tomer Gidron
    2726 *
    2827 */
     
    3837
    3938#include "HoverPrereqs.h"
    40 #include "HoverShip.h"
    4139
    4240#include <vector>
     
    4442#include "gametypes/Gametype.h"
    4543#include "HoverOrigin.h"
    46 #include "pickup/PickupSpawner.h"
    4744
    4845namespace orxonox
     
    5855                { this->origin_ = origin; }
    5956
    60             void start();
    61             void createFlags();
    62             void levelUp();
    63             void endLevel();
    64             void costLife();
    65 
    6657            inline int getNumberOfFlags() const
    6758                { return this->numberOfFlags_; }
    6859
    69             virtual Vector3 get3dCoordinates(int x, int y, float heightOffset);
    70 
    71             inline int getTotFlags() const
    72                 { return this->totFlags; }
    73 
    74             inline int getLives() const
    75                 { return this->lives; }
    76 
    77             inline int getLevel() const
    78                 { return this->level; }
    79 
    80             bool bLevelUpgradeHUD;
    81 
    8260        private:
    83 
    8461            WeakPtr<HoverOrigin> origin_;
    8562            std::vector<HoverFlag*> flags_;
    8663            int numberOfFlags_;
    8764            bool firstTick_;
    88             int level;
    89             int lives;
    90             int flagsTaken;
    91 
    92             int cellSize;
    93             int cellHeight;
    94             int numCells;
    95 
    96             int totFlags;
    97 
    98             std::vector<PickupSpawner*> pickupSpawners_;
    99 
    100             void toggleShowLevel(){bLevelUpgradeHUD = !bLevelUpgradeHUD;}
    101 
    102             Timer showLevelTimer;
    10365    };
    10466}
  • code/trunk/src/modules/hover/HoverFlag.cc

    r11493 r11495  
    8787        model_ = new Model(this->getContext());
    8888        model_->setMeshSource("ss_flag_eu.mesh");
    89         model_->setScale3D(Vector3(30, 30, 30));
    90         model_->setPosition(Vector3(xCoordinate*cellSize*1.0f + cellSize/2,50.0f,yCoordinate*cellSize*1.0f + cellSize/2));
     89        model_->setScale3D(Vector3(5, 5, 5));
     90        model_->setPosition(Vector3(xCoordinate*cellSize*1.0f + cellSize/2,10.0f,yCoordinate*cellSize*1.0f + cellSize/2));
    9191
    9292        this->attach(model_);
    9393
    9494        cs_ = new BoxCollisionShape(this->getContext());
    95         cs_->setHalfExtents(Vector3(30, 30, 30));
     95        cs_->setHalfExtents(Vector3(5, 5, 5));
    9696        cs_->setPosition(Vector3(xCoordinate*cellSize*1.0f + cellSize/2,0.0f,yCoordinate*cellSize*1.0f + cellSize/2));
    9797
  • code/trunk/src/modules/hover/HoverOrigin.cc

    r11493 r11495  
    2323 *      Manuel Meier
    2424 *   Co-authors:
    25  *      Tomer Gidron
     25 *      ...
    2626 *
    2727 */
     
    4545        RegisterObject(HoverOrigin);
    4646        checkGametype();
    47 
    48         //Initialization of variables (not really needed)
    49 
    50         pickupTemplate_ = "";
    51         pickupRepresentationTemplate_ = "";
    52 
    53         pickupTemplateSpeed_ = "";
    54         pickupRepresentationTemplateSpeed_ = "";
    55 
    56 
    57         pickupTemplateShrink_ = "";
    58         pickupRepresentationTemplateShrink_ = "";
    5947    }
    6048
     
    6654        XMLPortParam(HoverOrigin, "cellSize", setCellSize, getCellSize, xmlelement, mode);
    6755        XMLPortParam(HoverOrigin, "cellHeight", setCellHeight, getCellHeight, xmlelement, mode);
    68         XMLPortParam(HoverOrigin, "wallThickness", setWallThickness, getWallThickness, xmlelement, mode);
    69         XMLPortParam(HoverOrigin, "pickuptemplate", setPickupTemplate, getPickupTemplate, xmlelement, mode);
    70         XMLPortParam(HoverOrigin, "pickuprepresentationtemplate", setPickupRepresentationTemplate, getPickupRepresentationTemplate, xmlelement, mode);
    71         XMLPortParam(HoverOrigin, "pickuptemplatespeed", setPickupTemplateSpeed, getPickupTemplateSpeed, xmlelement, mode);
    72         XMLPortParam(HoverOrigin, "pickuprepresentationtemplatespeed", setPickupRepresentationTemplateSpeed, getPickupRepresentationTemplateSpeed, xmlelement, mode);
    73         XMLPortParam(HoverOrigin, "obstacletemplate", setObstacleTemplate, getObstacleTemplate, xmlelement, mode);
    74         XMLPortParam(HoverOrigin, "pickuptemplateshrink", setPickupTemplateShrink, getPickupTemplateShrink, xmlelement, mode);
    75         XMLPortParam(HoverOrigin, "pickuprepresentationtemplateshrink", setPickupRepresentationTemplateShrink, getPickupRepresentationTemplateShrink, xmlelement, mode);
    76         XMLPortParam(HoverOrigin, "groundtemplate", setGroundTemplate, getGroundTemplate, xmlelement, mode);
    7756    }
    78 
    7957
    8058    void HoverOrigin::checkGametype()
  • code/trunk/src/modules/hover/HoverOrigin.h

    r11493 r11495  
    2323 *      Manuel Meier
    2424 *   Co-authors:
    25  *      Tomer Gidron
     25 *      ...
    2626 *
    2727 */
     
    6666                { return this->cellHeight_; }
    6767
    68             inline void setWallThickness(int wallThickness)
    69                 { this->wallThickness_ = wallThickness; }
    70             inline int getWallThickness() const
    71                 { return this->wallThickness_; }
    72 
    73             //pickup template set and get for destroy hover pickup
    74 
    75             inline void setPickupTemplate(std::string pickupTemplate)
    76                 { this->pickupTemplate_ = pickupTemplate; }
    77             inline std::string getPickupTemplate() const
    78                 { return this->pickupTemplate_; }
    79 
    80             inline void setPickupRepresentationTemplate(std::string pickupRepresenationaTemplate)
    81                 { this->pickupRepresentationTemplate_ = pickupRepresenationaTemplate; }
    82             inline std::string getPickupRepresentationTemplate() const
    83                 { return this->pickupRepresentationTemplate_; }
    84 
    85             //pickup template get and set for damage hover pickup
    86 
    87             inline void setPickupTemplateSpeed(std::string pickupTemplateSpeed)
    88                 { this->pickupTemplateSpeed_ = pickupTemplateSpeed; }
    89             inline std::string getPickupTemplateSpeed() const
    90                 { return this->pickupTemplateSpeed_; }
    91 
    92             inline void setPickupRepresentationTemplateSpeed(std::string pickupRepresenationaTemplateSpeed)
    93                 { this->pickupRepresentationTemplateSpeed_ = pickupRepresenationaTemplateSpeed; }
    94             inline std::string getPickupRepresentationTemplateSpeed() const
    95                 { return this->pickupRepresentationTemplateSpeed_; }
    96 
    97 
    98             //pickup template get and set for shrink hover pickup
    99 
    100             inline void setPickupTemplateShrink(std::string pickupTemplateShrink)
    101                 { this->pickupTemplateShrink_ = pickupTemplateShrink; }
    102             inline std::string getPickupTemplateShrink() const
    103                 { return this->pickupTemplateShrink_; }
    104 
    105             inline void setPickupRepresentationTemplateShrink(std::string pickupRepresenationaTemplateShrink)
    106                 { this->pickupRepresentationTemplateShrink_ = pickupRepresenationaTemplateShrink; }
    107             inline std::string getPickupRepresentationTemplateShrink() const
    108                 { return this->pickupRepresentationTemplateShrink_; }
    109 
    110             //get and set for obstacle template
    111 
    112             inline void setObstacleTemplate(std::string obstacleTemplate)
    113                 { this->obstacleTemplate_ = obstacleTemplate; }
    114             inline std::string getObstacleTemplate() const
    115                 { return this->obstacleTemplate_; }       
    116 
    117             //get and set for ground template
    118 
    119             inline void setGroundTemplate(std::string groundTemplate)
    120                 { this->groundTemplate_ = groundTemplate; }
    121             inline std::string getGroundTemplate() const
    122                 { return this->groundTemplate_; } 
    123 
    12468        private:
    12569            void checkGametype();
    126 
    12770       
    12871            int numCells_;
    12972            int cellSize_;
    13073            int cellHeight_;
    131             int wallThickness_;
    132 
    133             // Tempaltes for the destroy hover pickup
    134             std::string pickupTemplate_;
    135             std::string pickupRepresentationTemplate_;
    136 
    137             // Tempaltes for the damage hover pickup
    138             std::string pickupTemplateSpeed_;
    139             std::string pickupRepresentationTemplateSpeed_;
    140 
    141             // Tempaltes for the shrink hover pickup
    142             std::string pickupTemplateShrink_;
    143             std::string pickupRepresentationTemplateShrink_;
    144 
    145             //Template for crate obstacle
    146             std::string obstacleTemplate_;
    147 
    148             //Template for ground cell
    149             std::string groundTemplate_;
    15074    };
    15175}
  • code/trunk/src/modules/hover/HoverShip.cc

    r11493 r11495  
    3333#include "core/CoreIncludes.h"
    3434#include "core/XMLPort.h"
    35 #include "Hover.h"
    36 //#include "NewHumanController.h"
    3735
    3836#include <BulletCollision/NarrowPhaseCollision/btManifoldPoint.h>
     
    114112        if (bBoost && this->isFloor_)
    115113        {
    116 
    117114            this->setVelocity(
    118115                this->getVelocity().x,
     
    123120        }
    124121    }
    125 
    126     Hover* HoverShip::getGame()
    127     {
    128         if (game == nullptr)
    129         {
    130             for (Hover* hover : ObjectList<Hover>())
    131                 game = hover;
    132         }
    133         return game;
    134     }
    135 
    136     void HoverShip::death()
    137     {
    138         getGame()->costLife();
    139         SpaceShip::death();
    140     }
    141122}
  • code/trunk/src/modules/hover/HoverShip.h

    r11493 r11495  
    3434
    3535#include "HoverPrereqs.h"
    36 #include "Hover.h"
    3736
    3837#include "worldentities/pawns/SpaceShip.h"
     
    7069            virtual void boost(bool bBoost) override;
    7170
    72         protected:
    73             virtual void death() override;
    74 
    7571        private:
    76             Hover* getGame();
    77             WeakPtr<Hover> game;
    7872            float jumpBoost_;
    7973            bool isFloor_;
  • code/trunk/src/modules/weapons/weaponmodes/HsW01.cc

    r11493 r11495  
    8585        XMLPortParam(HsW01, "projectileMesh", setMesh, getMesh, xmlelement, mode);
    8686        XMLPortParam(HsW01, "sound", setSound, getSound, xmlelement, mode);
    87         XMLPortParam(HsW01, "speed", setSpeed, getSpeed, xmlelement, mode);
    8887    }
    8988
  • code/trunk/src/modules/weapons/weaponmodes/HsW01.h

    r11493 r11495  
    112112            void muzzleflash();
    113113
    114             /**
    115             @brief Set the firing speed.
    116             @param speed The speed of the shot
    117             */
    118 
    119             void setSpeed(const float speed)
    120                 { this->speed_ = speed; }
    121 
    122             /**
    123             @brief Get the firing speed.
    124             @return Returns the speed of the shot
    125             */
    126 
    127             const float getSpeed() const
    128                 { return this->speed_; }
    129 
    130114            std::string material_; //!< The material.
    131115            std::string mesh_; //!< The mesh.
Note: See TracChangeset for help on using the changeset viewer.