TGB Newbie Question
by Matthew Kelley · in Technical Issues · 06/24/2008 (7:35 am) · 2 replies
Hello. I've downloaded the demo of TGB to help me decide if I wish to purchase it. Anyway I'm putting together a simple overhead view action game (overhead view like in the legend of Zelda).
My current problem is I can't get the sprite to animate in the direction that's being pressed. No mater what direction I'm moving it is always the default looking down static sprite.
Here is a snippet of the code the should be animating the hero:
if ($hero.moveUp == true)
{
%this.playAnimation(heroUpAni);
}
Any help would be appreciated.
My current problem is I can't get the sprite to animate in the direction that's being pressed. No mater what direction I'm moving it is always the default looking down static sprite.
Here is a snippet of the code the should be animating the hero:
if ($hero.moveUp == true)
{
%this.playAnimation(heroUpAni);
}
Any help would be appreciated.
#2
06/26/2008 (8:22 am)
Thanks for advice but I figured out the problem and it was an even more stupid mistake. My default sprite I created was static instead of an animation. Once I made it an animated sprite, problem solved.
Torque Owner Shaz
Why do you use $hero and %this? Is it possible the two are referring to different things? Have you tried $hero.playAnimation(heroUpAni) or (%this.moveUp == true)? Do you know that $hero.moveUp is being set correctly? Is heroUpAni the correct name for your animation? Do you know that your snippet of code is actually being called?
Check out the Platformer tutorial - sounds like the player animation in there is close to what you're after.