Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 12268 for code


Ignore:
Timestamp:
Apr 4, 2019, 2:40:29 PM (5 years ago)
Author:
ahuwyler
Message:

OrxoBlox in the HUD

Location:
code/branches/OrxoBlox_FS19
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw

    r12265 r12268  
    99  include("HUDTemplates3.oxo")
    1010  include("stats.oxo")
    11   include("pongHUD.oxo")
     11  include("OrxoBloxHUD.oxo")
    1212  include("templates/lodInformation.oxt")
    1313?>
    1414
    15 <Template name=pongbatcameras defaults=0>
    16   <PongBat>
     15<Template name=OrxoBloxbatcameras defaults=0>
     16  <OrxoBloxBat>
    1717    <camerapositions>
    1818      <CameraPosition position="0,150,0" pitch=-90 absolute=true />
     
    2121      <CameraPosition position="0,30, 90" drag=true mouselook=true />
    2222    </camerapositions>
    23   </PongBat>
     23  </OrxoBloxBat>
    2424</Template>
    2525
    26 <Template name=pongbat>
    27   <PongBat camerapositiontemplate=pongbatcameras>
     26<Template name=OrxoBloxbat>
     27  <OrxoBloxBat camerapositiontemplate=OrxoBloxbatcameras>
    2828    <attached>
    2929      <Model position="0,0,3" mesh="cube.mesh" scale3D="14,2,2" />
    30       <!--Model roll=180 mesh="pongbat.mesh" scale=0.045 /-->
     30      <!--Model roll=180 mesh="OrxoBloxbat.mesh" scale=0.045 /-->
    3131    </attached>
    32   </PongBat>
     32  </OrxoBloxBat>
    3333</Template>
    3434
    35 <Template name=pongball>
    36   <PongBall
     35<Template name=OrxoBloxball>
     36  <OrxoBloxBall
    3737   defScoreSound = "sounds/PlayerWinScore_cut.ogg"
    3838   defBatSound = "sounds/Button.ogg"
     
    4848      <EventTarget target=hiteffect />
    4949    </eventlisteners>
    50   </PongBall>
     50  </OrxoBloxBall>
    5151</Template>
    5252
     
    5555<Level
    5656  plugins = "OrxoBlox_FS19"
    57  gametype = "OrxoBlox"
     57 gametype = "Pong"
    5858>
    5959
     
    6464
    6565  <WorldAmbientSound source="Ganymede.ogg" looping="true" playOnLoad="true"/>
    66   <PongBot />
     66  <OrxoBloxBot />
    6767
    6868  <Scene
     
    7676    <MovableEntity rotationrate=5 rotationaxis="0,0,1">
    7777      <attached>
    78         <PongCenterpoint name=pongcenter dimension="200,120" balltemplate=pongball battemplate=pongbat ballspeed=200 ballaccfactor=1.0 batspeed=130 batlength=0.25>
     78        <OrxoBloxCenterpoint name=OrxoBloxcenter dimension="200,120" balltemplate=OrxoBloxball battemplate=OrxoBloxbat ballspeed=200 ballaccfactor=1.0 batspeed=130 batlength=0.25>
    7979          <attached>
    8080            <Model position="0,0,60" mesh="cube.mesh" scale3D="105,1,1" />
     
    9797            <ParticleSpawner name=scoreeffect_left position="-120,0,-45" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
    9898
    99 <!-- TODO: Create a Pong Score Sound and include it here.
     99<!-- TODO: Create a OrxoBlox Score Sound and include it here.
    100100This WorldSound works, but doesn't make sense, since it is played together with ambient/moodDependedDirectory/Ganymede.ogg -->
    101             <!--WorldSound name="scoreSound" position="0,0,0" source="sounds/PongScore_cut.ogg" >
     101            <!--WorldSound name="scoreSound" position="0,0,0" source="sounds/OrxoBloxScore_cut.ogg" >
    102102              <events>
    103103                <play>
    104                   <EventListener event=pongcenter />
     104                  <EventListener event=OrxoBloxcenter />
    105105                </play>
    106106              </events>
     
    114114
    115115          </attached>
    116         </PongCenterpoint>
     116        </OrxoBloxCenterpoint>
    117117      </attached>
    118118    </MovableEntity>
     
    129129              <EventName name=right />
    130130            </names>
    131             <EventListener event=pongcenter />
     131            <EventListener event=OrxoBloxcenter />
    132132          </EventFilter>
    133133        </spawn>
     
    145145              <EventName name=left />
    146146            </names>
    147             <EventListener event=pongcenter />
     147            <EventListener event=OrxoBloxcenter />
    148148          </EventFilter>
    149149        </spawn>
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/CMakeLists.txt

    r12254 r12268  
    66  BallGun/BallProjectile.cc
    77  OrxoBlox.cc
    8   OrxoBloxAI.cc
     8 
    99  OrxoBloxBall.cc
    1010  OrxoBloxBat.cc
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc

    r12264 r12268  
    4646#include "OrxoBloxBat.h"
    4747#include "OrxoBloxBot.h"
    48 #include "OrxoBloxAI.h"
     48#include "OrxoBloxStones.h"
    4949
    5050namespace orxonox
     
    7575
    7676        // Set the type of Bots for this particular Gametype.
    77         this->botclass_ = Class(OrxoBloxBot);
     77        this->botclass_ = Class(OrxoBloxBat);
    7878
    7979        this->scoreLimit_ = 10;
     
    193193    void OrxoBlox::end()
    194194    {
     195        ChatManager::message("You suck!!");
    195196        this->cleanup();
    196197
     
    233234        else
    234235            return;
    235 
    236         // If the player is an AI, it receives a pointer to the ball.
    237         if (player->getController() != nullptr && player->getController()->isA(Class(OrxoBloxAI)))
    238         {
    239             OrxoBloxAI* ai = orxonox_cast<OrxoBloxAI*>(player->getController());
    240             ai->setOrxoBloxBall(this->ball_);
    241         }
    242236    }
    243237
     
    278272        }
    279273
    280         // If a player gets enough points, he won the game -> end of game
    281         PlayerInfo* winningPlayer = nullptr;
    282         if (this->getLeftPlayer() && this->getScore(this->getLeftPlayer()) >= scoreLimit_)
    283             winningPlayer = this->getLeftPlayer();
    284 
    285         if (winningPlayer)
    286         {
    287              ChatManager::message(winningPlayer->getName() + " has won!");
    288              this->end();
    289         }
    290274
    291275        // Restart the timer to start the ball.
     
    317301    }
    318302
    319     /**
    320     @brief
    321         Get the right player.
    322     @return
    323         Returns a pointer to the player playing on the right. If there is no right player, nullptr is returned.
    324     */
    325303   
    326304}
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h

    r12260 r12268  
    8484
    8585            PlayerInfo* getLeftPlayer() const; //!< Get the left player.
    86             PlayerInfo* getRightPlayer() const; //!< Get the right player.
    8786
    8887        protected:
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBot.cc

    r12266 r12268  
    3535
    3636#include "core/CoreIncludes.h"
    37 #include "OrxoBloxAI.h"
    3837
    3938namespace orxonox
     
    4948        RegisterObject(OrxoBloxBot);
    5049
    51         this->defaultController_ = Class(OrxoBloxAI);
    52         this->createController();
     50       
    5351    }
    5452}
Note: See TracChangeset for help on using the changeset viewer.