dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: moving sprites

  1. #1
    Junior Member
    Join Date
    Oct 2004
    Location
    (obscence noun) off u pedo
    Posts
    1

    moving sprites

    hello i has a question regarding video game sprites
    how to u get the animated ones i.e sonic/mario running to run in a direction without moving each individual frame of them

  2. #2
    ------------------ uzerfrendly's Avatar
    Join Date
    Aug 2004
    Location
    Memphis
    Posts
    196
    the sprites are already animated for you in most instances. go here for some downloads.

    then what you do is put the walking right sprite in a mc as frame 1, left in another, and stopped in another. with a stop(); command in each frame. then make your arrow keys move that mc and also goto each frame to make the direction correct, for example:

    code:
     
    onClipEvent (enterFrame) {
    if (Key.isDown(Key.UP)) {
    this._y -= 7;
    this.gotoAndPlay(applicableframe);
    }
    }



    that should get you started

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center