Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6575


Ignore:
Timestamp:
Mar 20, 2010, 7:45:01 PM (15 years ago)
Author:
ebeier
Message:

SpeedPickup Class is now "working" (able to spawn/be picked up), but speed-manipulation of pawn still missing.

Location:
code/branches/ppspickups1
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ppspickups1/data/levels/includes/pickups_speed.oxi

    r6552 r6575  
    11<PickupRepresentation
    2     name="SpeedBoost"
    3     description="Speeds up the Ship for a certain time."
    4     spawnerTemplate="speedboostpickuprepresentation"
     2    name = "Small Speed Boost"
     3    description = "Adds a small amout of speed (?) to the ship."
     4    spawnerTemplate = "smallspeedpickupRepresentation"
    55>
    66    <pickup>
    7         <SpeedPickup template="speedboostpickup" />
     7        <SpeedPickup template=smallspeedpickup />
    88    </pickup>
    99</PickupRepresentation>
    10 <PickupRepresentation
    11     name="SpeedBoost"
    12     description="Speeds up the Ship for a certain time."
    13     spawnerTemplate="speedboostpickuprepresentation"
    14 >
    15     <pickup>
    16         <SpeedPickup template="speedboostpickup" />
    17     </pickup>
    18 </PickupRepresentation>
  • code/branches/ppspickups1/data/levels/pickup_ppstest1.oxw

    r6574 r6575  
    22  include("stats.oxo")
    33  include("hudtemplates3.oxo")
     4?>
    45
     6<?lua
    57  include("templates/spaceship_assff.oxt")
    68  include("templates/spaceship_pirate.oxt")
    7   -- include("templates/pickup_representation_templates_speed.oxt")
     9  include("templates/pickup_representation_templates_speed.oxt")
    810?>
    911
    1012<Level
    11  name         = "SpeedPickupTest"
    12  description  = "Test for the new Speed Pickup"
     13 name         = "Sample"
     14 description  = "Just a few tests"
    1315>
    1416  <Scene
     
    2022  include("includes/pickups_speed.oxi")
    2123?>
    22 <!--
    23     <PickupSpawner position="-100,0,-100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
     24
     25    <PickupSpawner position="-25,0,-100" triggerDistance="10" respawnTime="10" maxSpawnedItems="99">
    2426        <pickup>
    25             <SpeedPickup template="speedboostpickup" />
     27            <SpeedPickup template=smallspeedpickup />
    2628        </pickup>
    2729    </PickupSpawner>
    28 -->
     30
     31
    2932    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
    3033    <SpawnPoint position="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
    3134  </Scene>
    3235</Level>
    33 <?lua
    34   include("stats.oxo")
    35   include("hudtemplates3.oxo")
    36 
    37   include("templates/spaceship_assff.oxt")
    38   include("templates/spaceship_pirate.oxt")
    39   -- include("templates/pickup_representation_templates_speed.oxt")
    40 ?>
    41 
    42 <Level
    43  name         = "SpeedPickupTest"
    44  description  = "Test for the new Speed Pickup"
    45 >
    46   <Scene
    47     ambientlight = "0.8, 0.8, 0.8"
    48     skybox       = "Orxonox/Starbox"
    49   >
    50 
    51 <?lua
    52   include("includes/pickups_speed.oxi")
    53 ?>
    54 <!--
    55     <PickupSpawner position="-100,0,-100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
    56         <pickup>
    57             <SpeedPickup template="speedboostpickup" />
    58         </pickup>
    59     </PickupSpawner>
    60 -->
    61     <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
    62     <SpawnPoint position="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
    63   </Scene>
    64 </Level>
  • code/branches/ppspickups1/data/levels/templates/pickup_representation_templates_speed.oxt

    r6552 r6575  
    1 <Template name=speedboostpickupRepresentation>
     1<Template name=smallspeedpickupRepresentation>
    22    <PickupRepresentation>
    33        <spawner-representation>
    44            <StaticEntity>
    55                <attached>
    6                     <Billboard position="0,0,0" colour="1,0,0" material="Sphere2" scale=0.1>
     6                    <Billboard position="0,0,0" colour="1.0,0.0,0.0" material="Sphere2" scale=0.1>
    77                        <attached>
    8                             <Billboard position="0,0,0" colour="0,1,0" material="Cross" scale=1 />
     8                            <Billboard position="0,0,0" colour="1.0,1.0,0.0" material="Cross" scale=0.7 />
    99                        </attached>
    1010                    </Billboard>
     
    1515</Template>
    1616
    17 <Template name="speedboostpickup">
     17<Template name=smallspeedpickup>
    1818  <SpeedPickup
    19     speedAddition = "0"
    20     speedMultiplier = "2"
    21     duration = "10"
     19    duration = 10
     20    speedAdd = 1
     21    SpeedMultiply = 1
    2222    activationType = "immediate"
    2323    durationType = "once"
    2424  />
    2525</Template>
    26 <Template name=speedboostpickupRepresentation>
    27     <PickupRepresentation>
    28         <spawner-representation>
    29             <StaticEntity>
    30                 <attached>
    31                     <Billboard position="0,0,0" colour="1,0,0" material="Sphere2" scale=0.1>
    32                         <attached>
    33                             <Billboard position="0,0,0" colour="0,1,0" material="Cross" scale=1 />
    34                         </attached>
    35                     </Billboard>
    36                 </attached>
    37             </StaticEntity>
    38         </spawner-representation>
    39     </PickupRepresentation>
    40 </Template>
    41 
    42 <Template name="speedboostpickup">
    43   <SpeedPickup
    44     speedAddition = "0"
    45     speedMultiplier = "2"
    46     duration = "10"
    47     activationType = "immediate"
    48     durationType = "once"
    49   />
    50 </Template>
  • code/branches/ppspickups1/src/modules/pickup/items/SpeedPickup.cc

    r6574 r6575  
    7474    void SpeedPickup::initialize(void)
    7575    {
    76         this->duration_ = 0;
    77         this->speedAdd_ = 0;
    78         this->speedMultiply_ = 0;
     76        this->duration_ = 0.0;
     77        this->speedAdd_ = 0.0;
     78        this->speedMultiply_ = 1.0;
    7979
    8080        this->addTarget(ClassIdentifier<Pawn>::getIdentifier());
     
    269269    void SpeedPickup::setSpeedMultiply(float speedMultiply)
    270270    {
    271         if(speedMultiply > 0.0f)
     271        if(speedMultiply != 0.0f)
    272272        {
    273273            this->speedMultiply_ = speedMultiply;
     
    276276        {
    277277            COUT(1) << "Invalid speedMultiply in SpeedPickup." << std::endl;
    278             this->speedMultiply_ = 0.0;
     278            this->speedMultiply_ = 1.0;
    279279        }
    280280    }
Note: See TracChangeset for help on using the changeset viewer.