Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 30, 2017, 2:42:31 PM (7 years ago)
Author:
jkindle
Message:

Works whoow

Location:
code/branches/SuperOrxoBros_FS17
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/SuperOrxoBros_FS17/data/levels/SOB.oxw

    r11379 r11381  
    11<LevelInfo
    2  name = "SOOOOB"
    3  description = "Level for the coding tutorial."
     2 name = "SOOOOOOOOOOOB"
     3 description = "Jump as high as you can. Use the mouse to guide the jumper."
    44 tags = "minigame"
    5  screenshot = "codingtutorial.png"
    6  startingships = "spaceshipassff, spaceshipghost, spaceshipspacecruiser"
     5 screenshot = "jump.png"
    76/>
    87
    98<?lua
    10   include("HUDTemplates3.oxo")
     9  include("HUDTemplates3.oxo") 
     10  include("jumpHUD.oxo")
    1111  include("stats.oxo")
    12   include("templates/spaceshipAssff.oxt")
    13 
     12  include("templates/lodInformation.oxt")
    1413?>
    1514
    16 <Level plugins = "superorxobros" gametype="SOB">
    17  
     15<Template name=sobfigurecameras defaults=0>
     16  <SOBFigure>
     17    <camerapositions>
     18      <CameraPosition position="0,-150,0" absolute=false mouselook=false drag=false lookat="0,0,0"/>
     19    </camerapositions>
     20  </SOBFigure>
     21</Template>
    1822
     23
     24
     25
     26<Template name=sobFigureTemplate>
     27  <SOBFigure camerapositiontemplate=sobfigurecameras collisionType="dynamic">
     28    <attached>
     29      <Model position="0,0,0" mesh="JumpFigure.mesh" scale=1 pitch=90/>
     30    </attached>
     31
     32       <collisionShapes>
     33<!--         <BoxCollisionShape position="0,0,0" halfExtents="3,3,3" />
     34 -->        <SphereCollisionShape   yaw="20" pitch="20" roll="20" position="0,0,0" radius="10" /> 
     35      </collisionShapes>
     36
     37   
     38  </SOBFigure>
     39</Template>
     40
     41<Level
     42 plugins = "superorxobros"
     43 gametype = "SOB"
     44>-
     45
     46
     47  <templates>
     48    <Template link=lodtemplate_default />
     49  </templates>
    1950  <?lua include("includes/notifications.oxi") ?>
    2051
    21   <Scene
    22    ambientlight = "0.5, 0.5, 0.5"
    23    skybox       = "Orxonox/skyBoxBasic"
    24   >
     52  <WorldAmbientSound source="Ganymede.ogg" looping="true" playOnLoad="true"/>
     53 
     54
     55  <Scene ambientlight="1.0, 1.0, 1.0" skybox="Orxonox/skyBoxBasic">
     56    <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" />
     57
     58    <SpawnPoint position="991.729, -110.11, 435.404" orientation="0.534038, 0.563456, 0.212168, 0.593553" />
     59
     60    <MovableEntity>
     61      <attached>
     62        <SOBCenterpoint
     63          name=jumpcenter
     64 
     65          cameraOffset="10"
     66
     67         
     68          figureTemplate=sobFigureTemplate
     69         
     70          >
     71
     72          <attached>
    2573
    2674
    2775   
    28     <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" />
    29         <SpawnPoint position="991.729, -110.11, 435.404" orientation="0.534038, 0.563456, 0.212168, 0.593553" spawnclass=SpaceShip pawndesign=shipselection />
    30 
    31 
    32    
    33  <MovableEntity rotationrate=5 rotationaxis="0,0,1">
    34       <attached>
    35         <SOBCenterpoint>
    36           <attached>
    37             <Model position="0,0,60" mesh="cube.mesh" scale3D="105,1,1" />
    38             <Model position="0,0,-60" mesh="cube.mesh" scale3D="105,1,1" />
    39 
    40             <ParticleSpawner name=scoreeffect_right position="120,0, 45" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
    41             <ParticleSpawner name=scoreeffect_right position="120,0, 30" source="Orxonox/BigExplosion1part2" lifetime=3.0 autostart=0 />
    42             <ParticleSpawner name=scoreeffect_right position="120,0, 15" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
    43             <ParticleSpawner name=scoreeffect_right position="120,0,  0" source="Orxonox/BigExplosion1part2" lifetime=0.1 autostart=0 />
    44             <ParticleSpawner name=scoreeffect_right position="120,0,-15" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
    45             <ParticleSpawner name=scoreeffect_right position="120,0,-30" source="Orxonox/BigExplosion1part2" lifetime=3.0 autostart=0 />
    46             <ParticleSpawner name=scoreeffect_right position="120,0,-45" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
    47 
    48             <ParticleSpawner name=scoreeffect_left position="-120,0, 45" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
    49             <ParticleSpawner name=scoreeffect_left position="-120,0, 30" source="Orxonox/BigExplosion1part2" lifetime=3.0 autostart=0 />
    50             <ParticleSpawner name=scoreeffect_left position="-120,0, 15" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
    51             <ParticleSpawner name=scoreeffect_left position="-120,0,  0" source="Orxonox/BigExplosion1part2" lifetime=0.1 autostart=0 />
    52             <ParticleSpawner name=scoreeffect_left position="-120,0,-15" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
    53             <ParticleSpawner name=scoreeffect_left position="-120,0,-30" source="Orxonox/BigExplosion1part2" lifetime=3.0 autostart=0 />
    54             <ParticleSpawner name=scoreeffect_left position="-120,0,-45" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
    5576
    5677          </attached>
     
    5980    </MovableEntity>
    6081
     82    <StaticEntity position="0,-1,-10" collisionType="static">
     83      <attached>
     84         <Model  mesh="cube.mesh" scale3D="76,76,1" />
     85      </attached>
     86
     87      <collisionShapes>
     88        <BoxCollisionShape position="0,0,0" halfExtents="76,76,1" />
     89      </collisionShapes>
     90    </StaticEntity>
     91
     92     
    6193
    6294
  • code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOB.cc

    r11378 r11381  
    4141#include "gamestates/GSLevel.h"
    4242#include "chat/ChatManager.h"
     43#include "infos/PlayerInfo.h"
    4344
    4445#include "SOBCenterpoint.h"
    4546
    46 //#include "PongBat.h"
    47 //#include "PongBot.h"
    48 //#include "PongAI.h"
     47#include "SOBFigure.h"
     48#include "graphics/Camera.h"
    4949
    5050namespace orxonox
     
    6060    {
    6161        RegisterObject(SOB);
     62        camera = nullptr;
    6263
    6364        this->center_ = nullptr;
    64            figure_ = nullptr;
     65        figure_ = nullptr;
    6566
    6667    }
     
    7677    }
    7778
    78 
     79    void SOB::cleanup()
     80    {
     81        camera = nullptr;
     82    }
    7983
    8084        void SOB::start()
     
    8589            {
    8690                figure_ = new SOBFigure(center_->getContext());
    87                 figure_->addTemplate(center_->getFigureTemplate()); /
    88                 figure_->InitializeAnimation(center_->getContext()); //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
     91                figure_->addTemplate(center_->getFigureTemplate());
     92               // figure_->InitializeAnimation(center_->getContext()); //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    8993            }
    9094
     
    107111        }
    108112
    109         totalScreenShift_ = 0.0;
    110         screenShiftSinceLastUpdate_ = 0.0;
    111         sectionNumber_ = 0;
    112         adventureNumber_ = 0;
     113       // totalScreenShift_ = 0.0;
     114       // screenShiftSinceLastUpdate_ = 0.0;
     115        //sectionNumber_ = 0;
     116        //adventureNumber_ = 0;
    113117
    114         addStartSection();
    115         addSection();
    116         addSection();
     118        //addStartSection();
     119       // addSection();
     120       // addSection();
    117121    }
    118122
  • code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOB.h

    r11378 r11381  
    5656            void setCenterpoint(SOBCenterpoint* center)
    5757                { this->center_ = center; }
    58             void setFigureTemplate(const std::string& newTemplate)
    59                 { this->figureTemplate_ = newTemplate; }
    60            
    61             const std::string& getFigureTemplate() const
    62                 { return this->figureTemplate_; }
    63         
     58                virtual void start() override;
     59            virtual void end() override;
     60            virtual void spawnPlayer(PlayerInfo* player) override;
     61                        PlayerInfo* getPlayer() const;
     62
     63       
    6464         
    6565        protected:
     
    7070            WeakPtr<SOBFigure> figure_;
    7171            WeakPtr<Camera> camera;
     72       
    7273         
    7374    };
  • code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBCenterpoint.cc

    r11379 r11381  
    2121 *
    2222 *   Author:
    23  *      Fabian 'x3n' Landau
     23 *      Fabien Vultier
    2424 *   Co-authors:
    2525 *      ...
     
    2828
    2929/**
    30     @file PongCenterpoint.cc
    31     @brief Implementation of the PongCenterpoint class.
     30    @file SOBCenterpoint.cc
     31    @brief The SOBCenterpoint is a StaticEntity which represents the level of the minigame. All platforms, enemies and items are attached to the SOBCenterpoint.
    3232*/
    3333
     
    3636#include "core/CoreIncludes.h"
    3737#include "core/XMLPort.h"
    38 
    3938#include "SOB.h"
    4039
     
    4342    RegisterClass(SOBCenterpoint);
    4443
    45     /**
    46     @brief
    47         Constructor. Registers and initializes the object and checks whether the gametype is actually Pong.
    48     */
    4944    SOBCenterpoint::SOBCenterpoint(Context* context) : StaticEntity(context)
    5045    {
    5146        RegisterObject(SOBCenterpoint);
    5247
     48     
    5349
    54         this->checkGametype();
     50        checkGametype();
    5551    }
    5652
    57     /**
    58     @brief
    59         Method to create a PongCenterpoint through XML.
    60     */
    6153    void SOBCenterpoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    6254    {
    6355        SUPER(SOBCenterpoint, XMLPort, xmlelement, mode);
    6456
    65         //XMLPortParam(SOBCenterpoint, "dimension", setFieldDimension, getFieldDimension, xmlelement, mode);
    66         //XMLPortParam(SOBCenterpoint, "balltemplate", setBalltemplate, getBalltemplate, xmlelement, mode);
    67        // XMLPortParam(SOBCenterpoint, "battemplate", setBattemplate, getBattemplate, xmlelement, mode);
    68        // XMLPortParam(SOBCenterpoint, "ballspeed", setBallSpeed, getBallSpeed, xmlelement, mode);
    69        // XMLPortParam(SOBCenterpoint, "ballaccfactor", setBallAccelerationFactor, getBallAccelerationFactor, xmlelement, mode);
    70        // XMLPortParam(SOBCenterpoint, "batspeed", setBatSpeed, getBatSpeed, xmlelement, mode);
    71        // XMLPortParam(SOBCenterpoint, "batlength", setBatLength, getBatLength, xmlelement, mode);
     57     
     58        XMLPortParam(SOBCenterpoint, "cameraOffset", setCameraOffset, getCameraOffset, xmlelement, mode);
     59       
     60        XMLPortParam(SOBCenterpoint, "figureTemplate", setFigureTemplate, getFigureTemplate, xmlelement, mode);
     61       
    7262    }
    7363
    74     /**
    75     @brief
    76         Checks whether the gametype is Pong and if it is, sets its centerpoint.
    77     */
    7864    void SOBCenterpoint::checkGametype()
    7965    {
    80         if (this->getGametype() != nullptr && this->getGametype()->isA(Class(SOB)))
     66        if (getGametype() != nullptr && this->getGametype()->isA(Class(SOB)))
    8167        {
    8268            SOB* SOBGametype = orxonox_cast<SOB*>(this->getGametype());
  • code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBCenterpoint.h

    r11379 r11381  
    1 /*
    21/*
    32 *   ORXONOX - the hottest 3D action shooter ever to exist
     
    2221 *
    2322 *   Author:
    24  *      Fabian 'x3n' Landau
     23 *      Fabien Vultier
    2524 *   Co-authors:
    2625 *      ...
     
    2827 */
    2928
    30 /**
    31     @file PongCenterpoint.h
    32     @brief Declaration of the PongCenterpoint class.
    33     @ingroup Pong
    34 */
    35 
    3629#ifndef _SOBCenterpoint_H__
    3730#define _SOBCenterpoint_H__
    3831
    3932#include "superorxobros/SOBPrereqs.h"
    40 
    41 #include <string>
    42 
    43 #include <util/Math.h>
    44 
    4533#include "worldentities/StaticEntity.h"
    4634
     
    4836{
    4937   
    50    
    51  
     38    /**
     39    @brief
     40        @brief The SOBCenterpoint is a StaticEntity which represents the level of the minigame. All platforms, enemies and items are attached to the SOBCenterpoint.
     41    */
    5242    class _SOBExport SOBCenterpoint : public StaticEntity
    5343    {
    5444        public:
    55             SOBCenterpoint(Context* context); //!< Constructor. Registers and initializes the object and checks whether the gametype is actually Pong.
     45            SOBCenterpoint(Context* context); //!< Constructor. Registers and initializes the object and checks whether the gametype is actually SOB.
    5646            virtual ~SOBCenterpoint() {}
     47            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method to create a SOBCenterpoint through XML.
     48           
     49            void setFigureTemplate(const std::string& newTemplate)
     50                { this->figureTemplate_ = newTemplate; }
     51            const std::string& getFigureTemplate() const
     52                { return this->figureTemplate_; }
     53           
    5754
    58             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method to create a PongCenterpoint through XML.
    59 
     55            void setCameraOffset(const float cameraOffset)
     56                { this->cameraOffset_ = cameraOffset; }
     57            float getCameraOffset() const
     58                { return cameraOffset_; }
     59        private:
     60            void checkGametype();
     61           
     62            std::string figureTemplate_;
    6063   
    61 
    62         private:
    63             void checkGametype(); //!< Checks whether the gametype is Pong and if it is, sets its centerpoint.
     64       
     65            float cameraOffset_;
    6466    };
    6567}
  • code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.cc

    r11379 r11381  
    5656        timeSinceLastFire_ = 0.0;
    5757 
    58         gravityAcceleration_ = 8.0;
     58        gravityAcceleration_ = 250.0;//8.0
    5959       
    6060        dead_ = false;
     61        setAngularFactor(0.0);
    6162    }
    6263
     
    8081           
    8182           
    82                 velocity.z -= gravityAcceleration_;
     83
    8384           
    8485
     
    8889            if (dead_ == false)
    8990            {
     91
     92                if (firePressed_ && std::abs(velocity.z) < 0.1) {
     93                    velocity.z = 200;
     94                } else {
     95
     96                }
     97
     98
     99
     100
    90101                if (moveRightPressed_)
    91102                    velocity.x = 75;
    92103                else if (moveLeftPressed_)
    93                     velocity.x = 75;
     104                    velocity.x = -75;
    94105                else
    95106                    velocity.x = 0;
     
    99110                velocity.x = 0.0;
    100111            }
     112                        velocity.z -= gravityAcceleration_*dt;
    101113
    102114           
     
    116128        moveDownPressed_ = false;
    117129        moveLeftPressed_ = false;
     130        moveRightPressed_ = false;
    118131        moveDownPressed_ = false;
     132        firePressed_ = false;
    119133     
    120134    }
     
    169183 
    170184
    171     void SOBFigure::fired(unsigned int firemode)
    172     {
     185    void SOBFigure::boost(bool boost)
     186        {
    173187        firePressed_ = true;
    174188    }
  • code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.h

    r11379 r11381  
    4646           
    4747         
    48             virtual void fired(unsigned int firemode) override;
     48            virtual void boost(bool boost) override;
    4949           
    5050            //virtual void CollisionWithEnemy(SOBEnemy* enemy);
Note: See TracChangeset for help on using the changeset viewer.