Topic:   [SC] Walking animation   (Read 14110 times)


0 Members and 1 Guest are viewing this topic.

GMG Hendo


  • GMG-er

  • **


  • Posts: 155

  • [WITTY TEXT GOES HERE]
[SC] Walking animation
« on: May 10, 2009, 10:16:49 AM »
For this you need to have 3 sprites for each direction. I'm just going to give oyu an example of a walking down animation. First you MUST name your sprites down1,down2, and down3. Down one should be the right foot forward, down2 should be the even feet and down3 should be left foot forward. In the key down for the card put this:

Code: [Select]
SELECT CASE KEY$ 
CASE DOWNARROW$
  LET dir$ = "down"
WALK
END SELECT  

in the open card create and move sprite "down2" to wherever you want.

Make a method called WALK with this code:

Code: [Select]
ON TIMER 10 

  IF animation = 3 THEN
 LET animation = 1
PAUSETIMER
    ELSE
    LET animation = animation + 1
PUSHSPRITE 1,  0 , 7, 1
  END IF
  RECREATESPRITE 1, dir$ + STR$(animation)
END TIMER