Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11956


Ignore:
Timestamp:
May 11, 2018, 1:44:20 PM (7 years ago)
Author:
dreherm
Message:

Collisionshapes and Powerpoints

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

Legend:

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

    r11954 r11956  
    1616?>
    1717
     18<!-- include("templates/spaceshipEscort.oxt") -->
     19
    1820<Level
    1921  plugins = pacman
     
    3234
    3335    <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"/>
    34     <SpawnPoint team=0 position="0,10,245" lookat="0,0,0" spawnclass=PacmanGelb pawndesign=PacmanGelb />
     36    <SpawnPoint team=0 position="0,10,150" lookat="0,0,0" spawnclass=PacmanGelb pawndesign=PacmanGelb />
     37
     38    <!-- <SpawnPoint team=0 position="0,10,150" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort /> -->
    3539
    3640<!-- GHOSTS -->
     
    8690
    8791
    88 <!-- POINTS -->
    89 <PacmanPointSphere position="0,10,0">
     92<!-- POINTS first Line -->
     93<PacmanPointSphere position="-215,10,245">
     94    <attached>
     95        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     96    </attached>
     97</PacmanPointSphere>
     98
     99<PacmanPointSphere position="-197,10,245">
     100    <attached>
     101        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     102    </attached>
     103</PacmanPointSphere>
     104
     105<PacmanPointSphere position="-179,10,245">
     106    <attached>
     107        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     108    </attached>
     109</PacmanPointSphere>
     110
     111<PacmanPointSphere position="-161,10,245">
     112    <attached>
     113        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     114    </attached>
     115</PacmanPointSphere>
     116
     117<PacmanPointSphere position="-143,10,245">
     118    <attached>
     119        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     120    </attached>
     121</PacmanPointSphere>
     122
     123<PacmanPointSphere position="-125,10,245">
     124    <attached>
     125        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     126    </attached>
     127</PacmanPointSphere>
     128
     129<PacmanPointSphere position="-107,10,245">
     130    <attached>
     131        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     132    </attached>
     133</PacmanPointSphere>
     134
     135<PacmanPointSphere position="-89,10,245">
     136    <attached>
     137        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     138    </attached>
     139</PacmanPointSphere>
     140
     141<PacmanPointSphere position="-71,10,245">
     142    <attached>
     143        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     144    </attached>
     145</PacmanPointSphere>
     146
     147<PacmanPointSphere position="-53,10,245">
     148    <attached>
     149        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     150    </attached>
     151</PacmanPointSphere>
     152
     153<PacmanPointSphere position="-35,10,245">
     154    <attached>
     155        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     156    </attached>
     157</PacmanPointSphere>
     158
     159<PacmanPointSphere position="-20,10,245">
     160    <attached>
     161        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     162    </attached>
     163</PacmanPointSphere>
     164
     165<PacmanPointSphere position="-7,10,245">
     166    <attached>
     167        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     168    </attached>
     169</PacmanPointSphere>
     170
     171<PacmanPointSphere position="7,10,245">
     172    <attached>
     173        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     174    </attached>
     175</PacmanPointSphere>
     176
     177<PacmanPointSphere position="20,10,245">
     178    <attached>
     179        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     180    </attached>
     181</PacmanPointSphere>
     182
     183<PacmanPointSphere position="38,10,245">
     184    <attached>
     185        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     186    </attached>
     187</PacmanPointSphere>
     188
     189<PacmanPointSphere position="56,10,245">
     190    <attached>
     191        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     192    </attached>
     193</PacmanPointSphere>
     194
     195<PacmanPointSphere position="74,10,245">
     196    <attached>
     197        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     198    </attached>
     199</PacmanPointSphere>
     200
     201<PacmanPointSphere position="92,10,245">
     202    <attached>
     203        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     204    </attached>
     205</PacmanPointSphere>
     206
     207<PacmanPointSphere position="110,10,245">
     208    <attached>
     209        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     210    </attached>
     211</PacmanPointSphere>
     212
     213<PacmanPointSphere position="128,10,245">
     214    <attached>
     215        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     216    </attached>
     217</PacmanPointSphere>
     218
     219<PacmanPointSphere position="146,10,245">
     220    <attached>
     221        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     222    </attached>
     223</PacmanPointSphere>
     224
     225<PacmanPointSphere position="164,10,245">
     226    <attached>
     227        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     228    </attached>
     229</PacmanPointSphere>
     230
     231<PacmanPointSphere position="182,10,245">
     232    <attached>
     233        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     234    </attached>
     235</PacmanPointSphere>
     236
     237<PacmanPointSphere position="200,10,245">
    90238    <attached>
    91239        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     
    99247</PacmanPointSphere>
    100248
     249
     250<!-- POINTS seconde Line -->
     251<PacmanPointSphere position="-215,10,195">
     252    <attached>
     253        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     254    </attached>
     255</PacmanPointSphere>
     256
     257<PacmanPointSphere position="-197,10,195">
     258    <attached>
     259        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     260    </attached>
     261</PacmanPointSphere>
     262
     263<PacmanPointSphere position="-179,10,195">
     264    <attached>
     265        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     266    </attached>
     267</PacmanPointSphere>
     268
     269<PacmanPointSphere position="-161,10,195">
     270    <attached>
     271        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     272    </attached>
     273</PacmanPointSphere>
     274
     275<PacmanPointSphere position="-143,10,195">
     276    <attached>
     277        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     278    </attached>
     279</PacmanPointSphere>
     280
     281<PacmanPointSphere position="-125,10,195">
     282    <attached>
     283        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     284    </attached>
     285</PacmanPointSphere>
     286
     287<!-- 7 and 8 -->
     288
     289<PacmanPointSphere position="-71,10,195">
     290    <attached>
     291        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     292    </attached>
     293</PacmanPointSphere>
     294
     295<PacmanPointSphere position="-53,10,195">
     296    <attached>
     297        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     298    </attached>
     299</PacmanPointSphere>
     300
     301<PacmanPointSphere position="-35,10,195">
     302    <attached>
     303        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     304    </attached>
     305</PacmanPointSphere>
     306
     307<PacmanPointSphere position="-20,10,195">
     308    <attached>
     309        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     310    </attached>
     311</PacmanPointSphere>
     312
     313<!-- 13 and 14 -->
     314
     315<PacmanPointSphere position="20,10,195">
     316    <attached>
     317        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     318    </attached>
     319</PacmanPointSphere>
     320
     321<PacmanPointSphere position="38,10,195">
     322    <attached>
     323        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     324    </attached>
     325</PacmanPointSphere>
     326
     327<PacmanPointSphere position="56,10,195">
     328    <attached>
     329        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     330    </attached>
     331</PacmanPointSphere>
     332
     333<PacmanPointSphere position="74,10,195">
     334    <attached>
     335        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     336    </attached>
     337</PacmanPointSphere>
     338
     339<!-- 19 and 20 -->
     340
     341<PacmanPointSphere position="128,10,195">
     342    <attached>
     343        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     344    </attached>
     345</PacmanPointSphere>
     346
     347<PacmanPointSphere position="146,10,195">
     348    <attached>
     349        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     350    </attached>
     351</PacmanPointSphere>
     352
     353<PacmanPointSphere position="164,10,195">
     354    <attached>
     355        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     356    </attached>
     357</PacmanPointSphere>
     358
     359<PacmanPointSphere position="182,10,195">
     360    <attached>
     361        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     362    </attached>
     363</PacmanPointSphere>
     364
     365<PacmanPointSphere position="200,10,195">
     366    <attached>
     367        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     368    </attached>
     369</PacmanPointSphere>
     370
    101371<PacmanPointSphere position="215,10,195">
    102372    <attached>
     
    104374    </attached>
    105375</PacmanPointSphere>
     376
     377
     378
    106379
    107380
     
    122395
    123396  <!-- Edge --> 
    124   <BoxCollisionShape position="250,10,0" halfExtents="1,15,250" />
    125   <BoxCollisionShape position="-250,10,0" halfExtents="1,15,250" />
    126   <BoxCollisionShape position="0,10,250" halfExtents="250,15,1" />
    127   <BoxCollisionShape position="0,10,-250" halfExtents="250,15,1" />
     397  <BoxCollisionShape position="250,10,0" halfExtents="15,15,250" />
     398  <BoxCollisionShape position="-250,10,0" halfExtents="15,15,250" />
     399  <BoxCollisionShape position="0,10,250" halfExtents="250,15,15" />
     400  <BoxCollisionShape position="0,10,-250" halfExtents="250,15,15" />
    128401
    129402   <!-- Shapes in order -->   
     
    132405  <BoxCollisionShape position="200,10,-65" halfExtents="55,15,35" />
    133406  <BoxCollisionShape position="200,10,30" halfExtents="55,15,35" />
     407  <BoxCollisionShape position="-175,10,-195" halfExtents="30,15,20" /> <!-- 5 --> 
     408  <BoxCollisionShape position="-80,10,-195" halfExtents="40,15,20" />
     409  <BoxCollisionShape position="-175,10,-140" halfExtents="30,15,10" />
     410  <BoxCollisionShape position="0,10,-210" halfExtents="10,15,30" />
     411  <BoxCollisionShape position="80,10,-195" halfExtents="40,15,20" />
     412  <BoxCollisionShape position="175,10,-195" halfExtents="30,15,20" /> <!-- 10 -->
     413  <BoxCollisionShape position="175,10,-140" halfExtents="30,15,10" />
     414  <BoxCollisionShape position="0,10,-140" halfExtents="60,15,10" />
     415  <BoxCollisionShape position="0,10,-110" halfExtents="10,15,25" />
     416  <BoxCollisionShape position="-100,10,-90" halfExtents="10,15,60" />
     417  <BoxCollisionShape position="-70,10,-90" halfExtents="25,15,10" /> <!-- 15 -->
     418  <BoxCollisionShape position="100,10,-90" halfExtents="10,15,60" />
     419  <BoxCollisionShape position="70,10,-90" halfExtents="25,15,10" />
     420  <BoxCollisionShape position="0,10,-20" halfExtents="60,15,35" />
     421  <BoxCollisionShape position="-100,10,30" halfExtents="10,15,35" />
     422  <BoxCollisionShape position="0,10,50" halfExtents="60,15,10" /> <!-- 20 -->
     423  <BoxCollisionShape position="0,10,80" halfExtents="10,15,25" />
     424  <BoxCollisionShape position="100,10,30" halfExtents="10,15,35" />
     425  <BoxCollisionShape position="-175,10,100" halfExtents="30,15,10" />
     426  <BoxCollisionShape position="-155,10,130" halfExtents="10,15,25" />
     427  <BoxCollisionShape position="-75,10,100" halfExtents="35,15,10" /> <!-- 25 -->
     428  <BoxCollisionShape position="75,10,100" halfExtents="35,15,10" />
     429  <BoxCollisionShape position="175,10,100" halfExtents="30,15,10" />
     430  <BoxCollisionShape position="155,10,130" halfExtents="10,15,25" />
     431  <BoxCollisionShape position="-220,10,150" halfExtents="20,15,10" />
     432  <BoxCollisionShape position="-220,10,150" halfExtents="20,15,10" /> <!-- 30 -->
     433  <BoxCollisionShape position="0,10,150" halfExtents="60,15,10" />
     434  <BoxCollisionShape position="0,10,180" halfExtents="10,15,25" />
     435  <BoxCollisionShape position="-100,10,170" halfExtents="10,15,25" />
     436  <BoxCollisionShape position="-125,10,200" halfExtents="80,15,10" />
     437  <BoxCollisionShape position="100,10,170" halfExtents="10,15,25" /> <!-- 35 -->
     438  <BoxCollisionShape position="125,10,200" halfExtents="80,15,10" />
     439
    134440
    135441    </collisionShapes>
  • code/branches/3DPacman_FS18/src/modules/pacman/Pacman.cc

    r11954 r11956  
    4545
    4646       // firstGame = true;                   //needed for the HUD
    47         lives = 10;
     47        lives = 3;
    4848        point = 0;
    4949        level = 1;
     
    6868        //orxout() << timer << endl;
    6969        //orxout() << afraid << endl;
     70        //orxout() << totallevelpoint << endl;
    7071
    7172
     
    167168
    168169    void Pacman::posreset(){
    169         for(PacmanGhost* nextghost : ObjectList<PacmanGhost>()){
    170             nextghost->resetGhost();
     170        for(int i = 0; i<4; ++i){
     171            ghosts[i]->resetGhost();
    171172        }
    172173        player->setPosition(startposplayer);
     
    206207                nextghost->dontmove =  true;
    207208            };
    208            
    209209            i++;
    210210        }
     211
     212        totallevelpoint = ObjectList<PacmanPointSphere>().size();
     213
    211214    }
    212215
  • code/branches/3DPacman_FS18/src/modules/pacman/Pacman.h

    r11945 r11956  
    9696            bool bcolli = false;
    9797            float timer = 0;
    98             Vector3 startposplayer = Vector3(0,10,245);
    99             int totallevelpoint = 3;
     98            Vector3 startposplayer = Vector3(0,10,150);
     99            int totallevelpoint;
    100100            //bool firstGame;
    101101            bool afraid = false;
  • code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointAfraid.cc

    r11954 r11956  
    4545    {
    4646        RegisterObject(PacmanPointAfraid);
    47         this->setCollisionType(CollisionType::None); 
     47        this->setCollisionType(CollisionType::None);
    4848    }
    4949
     
    7373
    7474    bool PacmanPointAfraid::taken(Vector3 playerpos)
    75     {
    76       Vector3 resetposition = this->getPosition(); 
    77      
     75    {
     76        resetposition = this->getPosition();
    7877      if((abs(resetposition.x - playerpos.x)<1) && (abs(resetposition.z - playerpos.z)<1)){
    7978        this->setPosition(Vector3(resetposition.x, -50, resetposition.z));
  • code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointAfraid.h

    r11939 r11956  
    5050            void resetPacmanPointAfraid();
    5151        private:
    52            
    5352            Vector3 resetposition;
    5453    };
  • code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointSphere.cc

    r11915 r11956  
    4545    {
    4646        RegisterObject(PacmanPointSphere);
    47         this->setCollisionType(CollisionType::None); 
     47        this->setCollisionType(CollisionType::None);
    4848    }
    4949
     
    7474    bool PacmanPointSphere::taken(Vector3 playerpos)
    7575    {
    76       if((abs(this->resetposition.x - playerpos.x)<0.1) && (abs(this->resetposition.z - playerpos.z)<0.1)){
     76        resetposition = this->getPosition();
     77      if((abs(this->resetposition.x - playerpos.x)<5) && (abs(this->resetposition.z - playerpos.z)<5)){
    7778        this->setPosition(Vector3(resetposition.x, -50, resetposition.z));
    7879        return true;
Note: See TracChangeset for help on using the changeset viewer.