Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11862


Ignore:
Timestamp:
Apr 13, 2018, 1:08:46 PM (6 years ago)
Author:
dreherm
Message:

Work on player

Location:
code/branches/3DPacman_FS18
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/3DPacman_FS18/data/levels/3DPacman.oxw

    r11843 r11862  
    1313
    1414<?lua
    15   include("templates/spaceshipEscort.oxt")
     15  include("templates/PacmanGelb.oxt")
    1616?>
    1717
     
    2828
    2929    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
    30     <SpawnPoint team=0 position="0,10,245" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort />
     30    <SpawnPoint team=0 position="0,10,245" lookat="0,0,0" spawnclass=SpaceShip pawndesign=PacmanGelb />
    3131
    3232
  • code/branches/3DPacman_FS18/data/levels/templates/PacmanGelb.oxt

    r11831 r11862  
    11<Template name=PacmanGelb>
    2   <SpaceShip
     2  <PacmanGelb
    33   hudtemplate            = spaceshiphud
    44   camerapositiontemplate = spaceshipescortcameras
     
    6363  include("../includes/weaponSettingsEscort.oxi")
    6464?>
    65   </SpaceShip>
     65  </PacmanGelb>
    6666</Template>
    6767
    6868<Template name=spaceshipescortcameras defaults=0>
    69   <SpaceShip>
     69  <PacmanGelb>
    7070    <camerapositions>
    7171      <CameraPosition position="0,0, 60" drag=false mouselook=true />
    7272    </camerapositions>
    73   </SpaceShip>
     73  </PacmanGelb>
    7474</Template>
    7575
  • code/branches/3DPacman_FS18/src/modules/Pacman/3DPacman.cc

    r11859 r11862  
    4949        point = 0:
    5050        level = 1;
     51        Vector3 startposplayer = Vector3(0,10,245);
    5152
    5253    }
     
    7071        }
    7172
    72         i = 0:
    73         for(PacmanPointSphere* nextsphere : ObjectList<PacmanPointSphere>()){
    74             spheres[i] = nextsphere;
    75             i++;
    76         }
    77 
    7873        player = this->getPlayer();
    7974        if (player != nullptr)
     
    9085        }
    9186
     87        i = 0;
     88        for(PacmanPointSphere* nextsphere : ObjectList<PacmanPointSphere>()){
     89            if(collis(nextsphere.getPosition(), currentPosition)){
     90                takePoint(nextsphere);
     91            }
     92        }
     93
    9294        SUPER(3DPacman, tick, dt);
    9395
    9496    }
    95 
    9697
    9798
     
    103104
    104105    void 3DPacman::catched(){
    105         if(lives) this->end();
     106        if(!lives) this->end();
    106107        --lives;
    107108        this->posreset();
     
    111112        int i = 0;
    112113        for(PacmanGhost* nextghost : ObjectList<PacmanGhost>()){
    113             ghosts[i] = nextghost;
     114            nextghost.resetGhost();
    114115            i++;
    115116        }
    116        
     117        player.setPosition(startposplayer);
     118    }
     119
     120    void 3DPacman::takePoint(PacmanPointSphere* taken){
     121        ++point;
     122        if(point == totallevelpoint) this->levelUp;
     123
     124        Vector3 postaken = taken.getPosition();
     125        postaken.y = -50;
     126        taken.setPosition(postaken);
    117127    }
    118128
     
    147157    void 3DPacman::end()
    148158    {
    149         // DON'T CALL THIS!
    150         //      Deathmatch::end();
    151         // It will misteriously crash the game!
    152         // Instead startMainMenu, this won't crash.
    153159        if (Highscore::exists())
    154160        {
  • code/branches/3DPacman_FS18/src/modules/Pacman/CMakeLists.txt

    r11843 r11862  
    11SET_SOURCE_FILES(PICKUP_SRC_FILES
    22  PacmanGhost.cc
     3  PacmanGelb.cc
    34)
    45
  • code/branches/3DPacman_FS18/src/modules/Pacman/PacmanGelb.h

    r11859 r11862  
    3636
    3737
    38 #include "dodgerace/DodgeRacePrereqs.h"
     38#include "Pacman/PacmanPrereqs.h"
    3939
    4040#include "core/XMLPort.h"
     
    4444namespace orxonox
    4545{
    46     class _PacmanGelbExport PacmanGelb : public SpaceShip
     46    class _PacmanExport PacmanGelb : public SpaceShip
    4747    {
    4848        public:
     
    5353        private:
    5454            Vector3 actuelposition;
    55             btQuaternion actuelorient;
     55            Quaternion actuelorient;
    5656       
    57     }
     57    };
    5858}
    5959
  • code/branches/3DPacman_FS18/src/modules/dodgerace/DodgeRaceShip.cc

    r11071 r11862  
    106106
    107107        setPosition(pos);
    108         setOrientation(Vector3::UNIT_Y, Degree(270));
     108        //setOrientation(Vector3::UNIT_Y, Degree(270));
    109109
    110110        // Level up!
Note: See TracChangeset for help on using the changeset viewer.