Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9803


Ignore:
Timestamp:
Nov 21, 2013, 11:20:31 PM (10 years ago)
Author:
jo
Message:

The brick falldown acceleration is increased, but the velocity is limited, such that occasional break-throughs are prevented.

Location:
code/trunk/src/modules/tetris
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/tetris/Tetris.cc

    r9802 r9803  
    124124                this->startBrick();
    125125            }
    126         }
     126        } 
    127127    }
    128128
  • code/trunk/src/modules/tetris/TetrisBrick.cc

    r9801 r9803  
    107107        {
    108108            stone->setPosition(0.0f, 0.0f, 0.0f);
    109             stone->setName("Base");
    110109        }
    111110        else if(i == 1)
    112111        {
    113112            stone->setPosition(0.0f, size_, 0.0f);
    114             stone->setName("Y");
    115113        }
    116114        else if(i == 2)
     
    119117            {
    120118                stone->setPosition(0.0f, 2*size_, 0.0f);
    121                 stone->setName("2Y");
    122119            }
    123120            else if(this->shapeIndex_ == 3 || this->shapeIndex_ == 4|| this->shapeIndex_ == 5)
    124121            {
    125122                stone->setPosition(size_, 0, 0.0f);
    126                 stone->setName("X");
    127123            }
    128124            else if(this->shapeIndex_ == 2)
    129125            {
    130126                stone->setPosition(-size_, 0, 0.0f);
    131                 stone->setName("-X");
    132127            }
    133128        }
     
    137132            {
    138133                stone->setPosition(size_, size_, 0.0f);
    139                 stone->setName("XY");
    140134            }
    141135            else if(this->shapeIndex_ == 1)
    142136            {
    143137                stone->setPosition(0, 3*size_, 0.0f);
    144                 stone->setName("3Y");
    145138            }
    146139            else if(this->shapeIndex_ == 3 || this->shapeIndex_ == 7)
    147140            {
    148141                stone->setPosition(-size_, 0, 0.0f);
    149                 stone->setName("-X");
    150142            }
    151143            else if(this->shapeIndex_ == 4)
    152144            {
    153145                stone->setPosition(-size_, size_, 0.0f);
    154                 stone->setName("-XY");
    155146            }
    156147            else if(this->shapeIndex_ == 6)
    157148            {
    158149                stone->setPosition(size_, 0, 0.0f);
    159                 stone->setName("X");
    160150            }
    161151        }
     
    195185        if(value.x < 0) //speedup on key down
    196186        {
    197             this->setVelocity(this->getVelocity()*1.1);
     187            Vector3 v_new = this->getVelocity()*1.2;
     188            if (v_new.y < -400.0f) //limiting the speed to prevent break throughs.
     189                v_new.y = -400.0f;
     190            this->setVelocity(v_new);
    198191        }
    199192        else if(!this->lockRotation_) //rotate when key up is pressed
Note: See TracChangeset for help on using the changeset viewer.