Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 12, 2016, 1:45:44 PM (9 years ago)
Author:
tgidron
Message:

New Pickup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/tgidronFS16/src/modules/hover/Hover.cc

    r11177 r11182  
    121121           
    122122
    123             //Generate 5 PickupSpawners randomly (destroy hover pickup)
    124             for (int i = 0; i<5; i++)
     123            //Generate 3 PickupSpawners randomly (destroy hover pickup)
     124            for (int i = 0; i<3; i++)
    125125            {
    126126                PickupSpawner* pickupSpawner = new PickupSpawner(origin_->getContext());
     
    128128                pickupSpawner->setPosition(get3dCoordinates(rand()%numCells, rand()%numCells, 10.0f));
    129129                pickupSpawner->setPickupTemplateName(origin_->getPickupTemplate());
    130                 pickupSpawner->setMaxSpawnedItems(5);
     130                pickupSpawner->setMaxSpawnedItems(3);
    131131                pickupSpawner->setRespawnTime(30);
    132132                pickupSpawner->setTriggerDistance(5);
     
    135135            }
    136136           
    137             //Generate 5 PickupSpawners randomly (damage pickup)
    138             for (int i = 0; i<5; i++)
     137            //Generate 3 PickupSpawners randomly (speed pickup)
     138            for (int i = 0; i<3; i++)
    139139            {
    140140                PickupSpawner* pickupSpawner = new PickupSpawner(origin_->getContext());
    141141
    142142                pickupSpawner->setPosition(get3dCoordinates(rand()%numCells, rand()%numCells, 10.0f));
    143                 pickupSpawner->setPickupTemplateName(origin_->getPickupTemplateDam());
    144                 pickupSpawner->setMaxSpawnedItems(5);
     143                pickupSpawner->setPickupTemplateName(origin_->getPickupTemplateSpeed());
     144                pickupSpawner->setMaxSpawnedItems(3);
    145145                pickupSpawner->setRespawnTime(30);
    146146                pickupSpawner->setTriggerDistance(5);
     
    149149            }
    150150
     151            //Generate 3 PickupSpawners randomly (shrink pickup)
     152            for (int i = 0; i<3; i++)
     153            {
     154                PickupSpawner* pickupSpawner = new PickupSpawner(origin_->getContext());
     155
     156                pickupSpawner->setPosition(get3dCoordinates(rand()%numCells, rand()%numCells, 10.0f));
     157                pickupSpawner->setPickupTemplateName(origin_->getPickupTemplateShrink());
     158                pickupSpawner->setMaxSpawnedItems(3);
     159                pickupSpawner->setRespawnTime(30);
     160                pickupSpawner->setTriggerDistance(5);
     161                // Add pickup spawner to the pickup spawner list
     162                pickupSpawners_.push_back(pickupSpawner);
     163            }
     164
    151165            //*****************************************************************************
    152166
     167            //Generate a destroyable crate randomly on field
     168
    153169            Pawn* crate = new Pawn(origin_->getContext());
    154170
    155171            crate->setPosition(get3dCoordinates(rand()%numCells, rand()%numCells, 10.0f));
    156             crate->addTemplate(origin_->getObstacleTemplate());
    157 
     172            crate->addTemplate(origin_->getObstacleTemplate()); 
     173            crate->setInitialHealth(100.0f);
     174           
    158175
    159176
    160177
    161178             //If no lives are left, end game
    162             if(lives <= 0){
     179            if(lives <= 0)
     180            {
    163181                GSLevel::startMainMenu();
    164182            }
    165 
     183            // Debug
    166184            orxout() << this->origin_->getPickupTemplate() << endl;
    167185            orxout() << this->origin_->getPickupRepresentationTemplate() << endl;
    168186
    169             orxout() << this->origin_->getPickupTemplateDam() << endl;
    170             orxout() << this->origin_->getPickupRepresentationTemplateDam() << endl;
    171         }
     187            orxout() << this->origin_->getPickupTemplateSpeed() << endl;
     188            orxout() << this->origin_->getPickupRepresentationTemplateSpeed() << endl;
     189
     190            orxout() << this->origin_->getObstacleTemplate() << endl;
     191            orxout() << crate->getPosition() << endl;
     192        }
    172193    }
    173194
Note: See TracChangeset for help on using the changeset viewer.