Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 4 and Version 5 of code/doc/Pickups


Ignore:
Timestamp:
Mar 18, 2010, 4:31:28 PM (14 years ago)
Author:
dafrick
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • code/doc/Pickups

    v4 v5  
    142142Now it get's a little trickier. Therefore I'm just going to supply you with a recipe, or a set of steps you have to take, without which your pickup won't work.
    143143
     144==== Creating the class ====
     145For a new pickup you need to create a new class in modules/pickup/items. Your class needs to be derived from another pickup class, normally this would either be Pickupable or Pickup. Pickupable is (as mentioned earlier) the base class of all things that can be picked up, thus of all pickups. However you are brobably going to want to derive your class form Pickup, because it provides some useful methods. So have a look at Pickup.
     146
     147Once you have created your new pickup class you have to insert it in the PickupPrereqs.h file in the modules/pickup folder and in the CMakeList.txt file in the modules/pickup/items folder. Also have a look at other pickups to make sure you include all the necessary files in your class.
     148
     149Additionally you have to add your pickup as a friend of the PickupCarrier class. To that purpose open PickupCarrier.h in the orxonox/interfaces folder and add your class under
     150
     151{{{
     152//! Pre-declarations.
     153}}}
     154
     155and under
     156
     157{{{
     158//! Friends.
     159}}}
     160
     161==== Cosing the carriers ====
     162
     163work in progress...
     164
     165=== Making your object pickupable ===