A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Diagonal Movements within a game

  1. #1
    Junior Member
    Join Date
    Oct 2000
    Posts
    13
    Hi I'm trying to make a game but i am having trouble with getting to move the character to move in diagonal directions via mylti keypresses left + up = diagonal up left any suggestions as im really stuck.

    Thanks

    Cws

  2. #2
    Member
    Join Date
    Aug 2000
    Posts
    44
    I guess you are using buttons and then using the on key press handler.... well... but flash5 has the answer to your problem... Smartclips! just put the AS within the Movie Clip like this:

    onClipEvent(enterFrame){
    if (Key.isDown(Key.UP)){up += up}
    if (Key.isDown(Key.DOWN)){down += down}
    if (Key.isDown(Key.RIGHT)){right+= right}
    if (Key.isDown(Key.LEFT)){left-= left}
    }

    well.... i made up what's inside the {}... there you should put your own programming.....

    hope it helps

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