Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I want to ask that I have a player in my game. I may walk. I have a image which has five different frames for walk and two frames for standing position. I want to ask that how can I change the images on runtime depending on the player state? I have loaded the image in tiledtextureregion. Also player can walk in forward and backward direction as well. How to use the same image strip for walking back and forth? I am new to andengine.

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

You can flip the texture like so: myTextureRegion.setFlippedHorizontal(true);

or by using the sprite

mySprite.setFlippedHorizontal(true); // set false to flip it back

Have you looked at AnimatedSprite class? AnimatedSpriteClass

You could google for examples. It's in the API

share|improve this answer
    
Yes. It you are right. It worked. Thanks... –  Khawar Raza Aug 10 '12 at 11:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.