Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 11, 2017, 4:06:44 PM (6 years ago)
Author:
vyang
Message:

Projektile fliegen in 2D Ebene, jedoch in eine falsche Richtung. Kommentare hinzugefuegt

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DShip.cc

    r11645 r11660  
    2121 *
    2222 *   Author:
    23  *      Florian Zinggeler
     23 *      Viviane Yang
    2424 *   Co-authors:
    2525 *      ...
     
    2727 */
    2828
    29 /*TODO: orientation/direction of the ship must be defined
    30         implement shoot function ->or switch it on?
    31         switch off boosting particles in the back of the ship
     29/*  TODO:
    3230
    3331/**
     
    5452        this->height = 646;
    5553
    56         timer.setTimer(3.5f, true, createExecutor(createFunctor(&Asteroids2DShip::showposition, this)));
     54        //timer.setTimer(3.5f, true, createExecutor(createFunctor(&Asteroids2DShip::showorientation, this)));
    5755    }
    5856
     
    6462    }
    6563
     64    //Same thing for orientation
     65    void Asteroids2DShip::showorientation()
     66    {
     67        Quaternion ort = this->getOrientation();
     68        orxout() << "w = " << ort.w << " x = " << ort.x << " y = " << ort.y << "z = " << ort.z << endl;
     69    }
     70
    6671    void Asteroids2DShip::tick(float dt)
    6772    {
     
    6974        Vector3 pos = this->getPosition();
    7075
    71         //haelt ship innerhalb des Kamerafensters, kommt oben bzw seitlich wieder raus. Man spawnt in (0,0)
     76        //ensure that the ship stays in playing field
    7277        if(pos.x > width/2)   pos.x = -width/2;
    7378        if(pos.x < -width/2)  pos.x = width/2;
     
    7984        this->setPosition(pos);
    8085
    81         //update level
     86
    8287
    8388        //shoot?
     89    }
     90
     91    void Asteroids2DShip::boost(bool bBoost)
     92    {
     93        isFireing = bBoost;
    8494    }
    8595
     
    8898        if (getGame())
    8999            getGame()->levelUp();
    90     }
    91 
    92     void Asteroids2DShip::boost(bool bBoost)
    93     {
    94         //getGame()->bEndGame = bBoost;
    95100    }
    96101
     
    107112            bImmune = true;
    108113            isimmune.setTimer(3.0f, false, createExecutor(createFunctor(&Asteroids2DShip::toggleImmune, this)));
    109             orxout()<< "touched" << endl;
    110114        }
    111115        return false;
Note: See TracChangeset for help on using the changeset viewer.