Added comments to kart script functions

This commit is contained in:
Sachith Hasaranga Seneviratne 2014-08-15 21:35:20 +05:30
parent 635d05af5e
commit 772c923263
2 changed files with 8 additions and 3 deletions

View File

@ -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.
}
//-----------------------------------------------------------------------------

View File

@ -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);