Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 4, 2017, 3:17:59 PM (8 years ago)
Author:
jkindle
Message:

Fixed turning, added and finished Gumbas, added turnOnCollide for all NPC and items, added Flagstone - todo: add points on flagstone hit and go into a between lvl mode, then warp to lvl 2. AAH, and added onDeath fcts…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBMushroom.cc

    r11405 r11412  
    5555        speed_ = 0.0;
    5656        hasCollided_=false;
     57        goesRight_ = true;
     58        lastPos_ = getPosition();
     59        lastPos_.x -= 20;
     60        changeAllowed_ = true;
     61        changedOn_ = 0.0;
    5762       
    5863    }
     
    7176    bool SOBMushroom::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) {
    7277
    73 //orxout() << "Watshc bum baem" << endl;
     78
     79if (changeAllowed_ && otherObject->getMass() != -1) {
     80                goesRight_ = !goesRight_;
     81                changeAllowed_ = false;
     82}
     83
     84orxout() << "Watshc bum baem" << otherObject->getMass()<< endl;
    7485return true;
    7586    }
     
    90101        SUPER(SOBMushroom, tick, dt);
    91102
    92           Vector3 velocity = getVelocity();
     103        if (!changeAllowed_) {
     104            changedOn_+= dt;
     105            if (changedOn_> 200) {
     106                changeAllowed_ = true;
     107                changedOn_ = 0.0;
     108
     109        }
     110    }
     111       
     112
     113        int dir = 1;
     114        if (!goesRight_)
     115            dir = -1;
     116
     117        Vector3 velocity = getVelocity();
    93118        velocity.z -= gravityAcceleration_*dt;
    94         velocity.x = speed_;
     119        velocity.x = dir*speed_;
    95120        setVelocity(velocity);
    96121
    97122
    98123   
     124        lastPos_ = getPosition();
     125            }
     126
    99127
    100128}
    101 }
Note: See TracChangeset for help on using the changeset viewer.