Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 20 and Version 21 of pps/tutorial


Ignore:
Timestamp:
Mar 9, 2011, 11:15:07 AM (13 years ago)
Author:
dafrick
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • pps/tutorial

    v20 v21  
    3838Before you start coding there's one [wiki:howto/XMLPort page] which is extremely useful for the following tasks. You might want to have a look at it.
    3939
     40== The task ==
     41Our goal  is to create a drone in Orxonox that, that does some kind of autonomous flying.
     42In Orxonox we try our best to separate different kinds of functionality. You will see, that this is also the case here.
     43In the case of the drone we want to create we separate the drone itself (called AutonomousDrone) from the entity that controls  the drone (called the AutonomousDroneController) and the thing that gives shape and texture to our drone (basically that is the model). Or put more crudely, the AutonomousDrone is the physical entity, the AutonomousDroneController is its intelligence and the model is it's visual representation. This is done for several reasons, the most important being, that with this kind of separation we can have multiple  controllers for just one drone, we could also have one controller for multiple types of flying objects. That makes your code more generic and leads to cleaner code, less dependencies and also less code.
     44
    4045== The AutonomousDrone ==
     46At first we need to create the drone itself. The drone provides the functionality of physically having a place in the game world (because it's a WorldEntity) and being able to move in it.
     47
    4148{{{
    4249#!html
     
    6875
    6976== The AutonomousDroneController ==
    70 Now you will finish the AutonomousDroneController which gets called each tick and steers the drone.
     77Now you will finish the AutonomousDroneController which gets called each tick and steers the drone using the functionality of movement in the game world that the drone provides.
     78
    7179 1. Open the file ''AutonomousDroneController.cc'' and look at it (''src/orxonox/controllers/'').
    7280 2. Have a look at the constructor and make sure nothing is missing (think of the core).
     
    8088
    8189== The XML Part ==
     90As a last step we will include the drone in our level and add the visual part of the drone, the model. (and some other stuff, too)
     91
    8292Now that you finished the classes you can recompile the project. Afterwards open the level file:
    8393 1. Open ''tutorial/data/levels/tutorial.oxw''.