Game Development Community

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.

About the author

Recent Threads


#1
06/25/2008 (5:35 pm)
As another newbie, without seeing your code (a little more than what you've provided) I can make a few guesses...

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.
#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.