Thread: Allegro sprite animation?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User godly 20's Avatar
    Join Date
    Jan 2011
    Location
    Italy
    Posts
    29

    Question Allegro sprite animation?

    Ok so this is the image which contains all possible movements:http://dc251.4shared.com/img/7j1ytD2...rite-anim2.bmp
    And this is the code that moves the sprite:
    Code:
    if(key [KEY_LEFT]) x-=1 ; //walks left
                if((key [KEY_LEFT]) && (key [KEY_R])) x-=2; //runs left
                if(key [KEY_RIGHT]) x+=1; // walks right
                if((key [KEY_RIGHT]) && (key [KEY_R])) x+=2; //runs right     
                if(key [KEY_DOWN]) y+=1; //walks down
                if((key [KEY_DOWN]) && (key [KEY_R])) y+=2; //runs down       
                if(key [KEY_UP]) y-=1; // walk up
                if((key [KEY_UP]) && (key [KEY_R])) y-=2; //runs up
    How can i make it do the right animation? Please HELP!!
    Last edited by godly 20; 01-20-2011 at 09:54 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Animation class not working
    By VirtualAce in forum Game Programming
    Replies: 5
    Last Post: 03-02-2005, 06:48 AM
  2. Game Programming FAQ
    By TechWins in forum Game Programming
    Replies: 5
    Last Post: 09-29-2004, 02:00 AM
  3. sprite rotation in allegro
    By thedumbmutt in forum Game Programming
    Replies: 4
    Last Post: 01-14-2003, 08:43 AM
  4. problem in allegro with sprite leaving trail
    By Leeman_s in forum C++ Programming
    Replies: 18
    Last Post: 09-13-2002, 03:04 PM
  5. Special Allegro Information
    By TechWins in forum Game Programming
    Replies: 12
    Last Post: 08-20-2002, 11:35 PM

Tags for this Thread