Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 22, 2014, 3:05:46 PM (10 years ago)
Author:
fvultier
Message:

new items added. improved level generator.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickupsFS14/src/modules/jump/JumpItem.cc

    r10050 r10074  
    5656        RegisterObject(JumpItem);
    5757
    58         this->figure_ = 0;
    59         setProperties(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
    60         this->setPosition(Vector3(0,0,0));
    61         this->setVelocity(Vector3(0,0,0));
    62         this->setAcceleration(Vector3(0,0,0));
     58        attachedToFigure_ = false;
     59
     60        figure_ = 0;
     61        height_ = 0.0;
     62        width_ = 0.0;
     63        setPosition(Vector3(0,0,0));
     64        setVelocity(Vector3(0,0,0));
     65        setAcceleration(Vector3(0,0,0));
    6366    }
    6467
     
    6972    JumpItem::~JumpItem()
    7073    {
    71         /*if (this->isInitialized())
    72         {
    73             if (this->bDeleteBats_)
    74                 delete this->figure_;
    7574
    76             delete[] this->batID_;
    77         }*/
    7875    }
    7976
     
    8279    {
    8380        SUPER(JumpItem, XMLPort, xmlelement, mode);
     81
     82        XMLPortParam(JumpItem, "height", setHeight, getHeight, xmlelement, mode);
     83        XMLPortParam(JumpItem, "width", setWidth, getWidth, xmlelement, mode);
    8484    }
    8585
     
    9494    {
    9595        SUPER(JumpItem, tick, dt);
    96 
    97         // Get the current position, velocity and acceleration of the enemy.
    98         Vector3 position = getPosition();
     96        // Get the current position, velocity and acceleration of the item.
     97        Vector3 position = getWorldPosition();
    9998        Vector3 velocity = getVelocity();
    10099
     
    109108        }
    110109
    111         // Set the position, velocity and acceleration of the enemy, if they have changed.
     110        // Set the position, velocity and acceleration of the item, if they have changed.
    112111        if (velocity != getVelocity())
     112        {
    113113            setVelocity(velocity);
    114         if (position != getPosition())
    115             setPosition(position);
    116 
    117 
     114        }
    118115    }
    119116
     
    125122        upperBoundary_ = newUpperBoundary;
    126123
    127         this->setVelocity(Vector3(newHSpeed,0,newVSpeed));
     124        setVelocity(Vector3(newHSpeed,0,newVSpeed));
    128125    }
    129126
Note: See TracChangeset for help on using the changeset viewer.