Game Development Community

Place to learn & ask about scripting

by Tony84 · in Torque X 2D · 12/24/2009 (9:03 am) · 2 replies

I recently purchased TGB as trial version convinced me to give another try at trying to start my own little project. And by little I mean little, my humble intention is to remake a controllable megaman who can jump, walk right and left.

Even though I'm learning how to script and I have read tutorials for scripting/coding languages my entire life, I never quite got catch of them. All of them seem to describe coding phenomenons on very general level:

"Variable is a value that may vary in it's sum/content based on what changes have been made or will be made to it"

Very few tutorials open up exact meaning of each line in the way you understand components relations to each other.

Long story short: I'm looking for good "noobfriendly" tutorials for scripting and also place where to ask about following problem:


function Up()
{

if($MEGA.LinearVelocityY == 0)
{
$MEGA.playAnimation(herojump);
$MEGA.setLinearVelocityY( -$MEGA.Hyppynopeus );
$MEGA.ilmassa(true);

}

else
{
$MEGA.playAnimation(herojump);
$MEGA.setLinearVelocityY(0);
}

What code is supposed to do: If in air megaman can't jump again from midair, but waits until megaman object ain't moving in vertical fashion anymore.


#1
12/24/2009 (3:55 pm)
This is the wrong forum (TorqueX 2D not TGB).
#2
12/24/2009 (4:25 pm)
Thank you for your reply, sorry about posting on wrong forum =)

I'll try my luck on TGB side of the forums.