Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 22, 2018, 1:04:40 PM (7 years ago)
Author:
dreherm
Message:

Debugged levelup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/3DPacman_FS18/src/modules/pacman/PacmanGhost.cc

    r11978 r11979  
    117117        if(this->ismoving){
    118118            if(!(abs(this->actuelposition.z-target_z)<0.5)) {
    119                 velocity = Vector3(0,0,-sgn(this->actuelposition.z-this->target_z)*2);
     119                velocity = Vector3(0,0,-sgn(this->actuelposition.z-this->target_z));
    120120                move(dt, actuelposition, velocity);
    121121            }   
    122122            if(!(abs(this->actuelposition.x-target_x)<0.5)){
    123                 velocity = Vector3(-sgn(this->actuelposition.x-this->target_x)*2,0,0);
     123                velocity = Vector3(-sgn(this->actuelposition.x-this->target_x),0,0);
    124124                move(dt, actuelposition, velocity);
    125125            }
     
    440440    void PacmanGhost::move(float dt, Vector3 actuelposition, Vector3 velocity){
    441441        if(!dontmove){
    442             this->setPosition(Vector3(actuelposition.x+20*velocity.x*dt,10,actuelposition.z+20*velocity.z*dt));
    443         if((abs(abs(velocity.x)-2)<0.1) && (abs(velocity.z-0)<0.1))
     442            this->setPosition(Vector3(actuelposition.x+speed*velocity.x*dt,10,actuelposition.z+speed*velocity.z*dt));
     443        if((abs(abs(velocity.x)-1)<0.1) && (abs(velocity.z-0)<0.1))
    444444            if(velocity.x<0){
    445445                 this->setOrientation(Quaternion(Radian(-1.57), Vector3(0, 1, 0))); 
     
    448448                 this->setOrientation(Quaternion(Radian(1.57), Vector3(0, 1, 0))); 
    449449            }
    450         if((abs(abs(velocity.z)-2)<0.1) && (abs(velocity.x-0)<0.1))
     450        if((abs(abs(velocity.z)-1)<0.1) && (abs(velocity.x-0)<0.1))
    451451            if(velocity.z<0){
    452452                 this->setOrientation(Quaternion(Radian(3.14), Vector3(0, 1, 0))); 
     
    485485
    486486    void PacmanGhost::levelupvelo(){
    487         velocity.x = velocity.x + 2;
    488         velocity.y = velocity.y + 2;
    489         velocity.z = velocity.z + 2;
     487        speed ++;
    490488    }
    491489}
Note: See TracChangeset for help on using the changeset viewer.