Changes between Version 5 and Version 6 of pps/tutorial_basic
- Timestamp:
- Sep 30, 2008, 3:56:58 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
pps/tutorial_basic
v5 v6 40 40 41 41 == TutorialShip Class == 42 We have derived a new type of SpaceShip for you:TutorialShip. The back end doesn't have to bother you (you will notice that some functions don't seem to be doing anything at all). [[br]]43 At the moment, you are using the SpaceShip class. We would like to change this. Fortunately this can be done in an XML file where we load the level.42 We have derived a new type of !SpaceShip for you: !TutorialShip. The back end doesn't have to bother you (you will notice that some functions don't seem to be doing anything at all). [[br]] 43 At the moment, you are using the !SpaceShip class. We would like to change this. Fortunately this can be done in an XML file where we load the level. 44 44 1. Go to your media repository (orxonox/Media) and open ''tutorial.oxw'' in the ''level'' folder with a text editor like vim, nano, etc. 45 1. Find the second paragraph (about 5th line) and change '' SpaceShip'' to ''TutorialShip''45 1. Find the second paragraph (about 5th line) and change ''!SpaceShip'' to ''!TutorialShip'' 46 46 1. Save the file. You can keep it open, we need it again later. 47 47 Next thing will be to change the code accordingly, since the game will probably crash now when started. [[br]] 48 48 We organise our source files via CMake as you have already found out. You now have to tell CMake to also compile the ''TutorialShip'': 49 49 1. Open orxonox/trunk/src/orxonox/CMakeLists.txt 50 1. You will see a large list of source files (*.cc). You can add "oxonox/TutorialShip.cc" anywhere you like, but it is preferred to organise the file a little bit. So look for SpaceShip.cc and add things there.50 1. You will see a large list of source files (*.cc). You can add "oxonox/TutorialShip.cc" anywhere you like, but it is preferred to organise the file a little bit. So look for !SpaceShip.cc and add things there. 51 51 1. Save and close. 52 52 The interesting part: Modifying the C++ code. '''Open orxonox/trunk/src/orxonox/objects/TutorialShip.cc'''. As you have already heard from Fabian, the Core Framework is like a language extension to C++. But it cannot be 100% automatic. That means you have to add a few lines accordingly: