Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8417 in orxonox.OLD for branches/script_engine/src


Ignore:
Timestamp:
Jun 14, 2006, 6:31:10 PM (18 years ago)
Author:
snellen
Message:

helicopter is scripted!

Location:
branches/script_engine/src
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/script_engine/src/lib/gui/gl/glgui_box.cc

    r8145 r8417  
    1717
    1818#include "glgui_box.h"
     19#include <cassert>
    1920
    2021namespace OrxGui
  • branches/script_engine/src/lib/gui/gl/glgui_handler.cc

    r8324 r8417  
    2323
    2424#include "class_list.h"
     25#include <cassert>
    2526
    2627
  • branches/script_engine/src/lib/script_engine/lunartest2.lua

    r8408 r8417  
    2222
    2323function main(arg)
    24   io.write("hello i am main!")
     24  io.write("hello i am main!\n")
    2525  -- use parameter
    2626  io.write("main received ", arg)
    2727  io.write(" as parameter\n")
    2828
    29  o = Object()
    30   o:printName()
     29 
    3130  --call member of an inserted object
    3231  Obj:printName()
    3332
    3433  --create object of a registered type
    35   --o = Object()
    36   --o:printName()
     34  o = Object()
     35  o:printName()
    3736
    3837  --take returnvalue from c
  • branches/script_engine/src/world_entities/script_trigger.cc

    r8408 r8417  
    142142     {
    143143       testScriptingFramework();
    144      /*if(!(script->selectFunction(this->functionName,0)) )
     144     if(!(script->selectFunction(this->functionName,0)) )
    145145       printf("Error ScriptTrigger: Selection of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str());
    146146     if( !(script->executeFunction()) )
    147        printf("Error ScriptTrigger: Execution of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str());*/
     147       printf("Error ScriptTrigger: Execution of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str());
    148148     }
    149149}
  • branches/script_engine/src/world_entities/space_ships/helicopter.h

    r8408 r8417  
    1212#include "sound_buffer.h"
    1313#include "sound_source.h"
     14
     15#include "script_class.h"
    1416
    1517class Helicopter : public Playable
     
    3840    virtual void process(const Event &event);
    3941   
    40     virtual void moveUp(bool move){bUp = move;};
     42    virtual void moveUp(bool move){bAscend = move;};
     43    virtual void moveDown(bool move){bDescend = move;};
    4144
    4245
     
    8083};
    8184
    82 //CREATE_SCRIPTABLE_CLASS(Helicopter, CL_HELICOPTER,
    83                        // addMethod("moveUp", ExecutorLua1<Object,bool>(&Helicopter::moveUp))
    84                        // );
     85CREATE_SCRIPTABLE_CLASS(Helicopter, CL_HELICOPTER,
     86                        addMethod("moveUp", ExecutorLua1<Helicopter,bool>(&Helicopter::moveUp))
     87                        ->addMethod("moveDown", ExecutorLua1<Helicopter,bool>(&Helicopter::moveDown))
     88                        );
    8589
    8690
Note: See TracChangeset for help on using the changeset viewer.