From 772c923263e774b07f115dd7b4790e5d966099a8 Mon Sep 17 00:00:00 2001 From: Sachith Hasaranga Seneviratne Date: Fri, 15 Aug 2014 21:35:20 +0530 Subject: [PATCH] Added comments to kart script functions --- src/scriptengine/script_engine.cpp | 4 ++-- src/scriptengine/script_kart.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/scriptengine/script_engine.cpp b/src/scriptengine/script_engine.cpp index b9992a5bc..f01db33ba 100644 --- a/src/scriptengine/script_engine.cpp +++ b/src/scriptengine/script_engine.cpp @@ -89,8 +89,7 @@ std::string getScript(std::string scriptName) } //----------------------------------------------------------------------------- /** runs the specified script -* \param ident Identifier = basename of the directory the track is in. -* \return The corresponding track object, or NULL if not found +* \param ident scriptName = name of script to run */ void ScriptEngine::runScript(std::string scriptName) { @@ -233,6 +232,7 @@ void ScriptEngine::configureEngine(asIScriptEngine *engine) // without having to recompile all the scripts. } +//----------------------------------------------------------------------------- diff --git a/src/scriptengine/script_kart.cpp b/src/scriptengine/script_kart.cpp index 3cb5ae1a7..7931191cc 100644 --- a/src/scriptengine/script_kart.cpp +++ b/src/scriptengine/script_kart.cpp @@ -31,7 +31,7 @@ namespace Scripting namespace Kart { - + //Squashes the specified kart, specified time void squashKart(asIScriptGeneric *gen) { int id = (int)gen->GetArgDWord(0); @@ -39,6 +39,7 @@ namespace Scripting AbstractKart* kart = World::getWorld()->getKart(id); kart->setSquash(time, 0.5); //0.5 * max speed is new max for squashed duration } + //Teleports the kart to the specified Vec3 location void teleportKart(asIScriptGeneric *gen) { int id = (int)gen->GetArgDWord(0); @@ -57,6 +58,8 @@ namespace Scripting s.setRotation(btQuaternion(btVector3(0.0f, 1.0f, 0.0f), angle)); World::getWorld()->moveKartTo(kart, s); } + //Attempts to project kart to the given 2D location, to the position + //with height 0, at a 45 degree angle. void jumpKartTo(asIScriptGeneric *gen) { //attempts to project kart to target destination @@ -83,6 +86,7 @@ namespace Scripting kart->setVelocity(btVector3(velocity * normalized_dx, velocity, velocity * normalized_dy)); } + //Bind kart location void getKartLocation(asIScriptGeneric *gen) { int id = (int)gen->GetArgDWord(0); @@ -93,6 +97,7 @@ namespace Scripting gen->SetReturnObject(pointer); } + //Bind setter for velocity void setVelocity(asIScriptGeneric *gen) { int id = (int)gen->GetArgDWord(0);