The McLeodGaming forums were permanently closed on April 30th, 2020. You are currently viewing a read-only archive.
View unanswered posts | View active topics It is currently Fri May 15, 2020 5:42 am

Forum rules


IMPORTANT

This Forum is for Flash related questions ONLY! Do not ask questions about spriting, Game Maker, Photoshop, or anything else not related to Flash.



 [ 2 posts ] 
[Question] Action keys 
Author Message

Joined: Wed Jan 28, 2009 5:41 pm
Posts: 2
ugh I'm making a game i got all the movement but i want it to attack when i press spacebar and by changing sprite??????????
got any help (I use Flash8) :?:


Wed Jan 28, 2009 5:48 pm
User avatar

Joined: Mon Aug 11, 2008 1:09 pm
Posts: 166
Location: England lol
Gender: Male
Currently Playing: Minecraft
Based on what sprite is in which frame of a movie clip - you can do a test for which key is pressed and make the movie clip jump to the right frame.

For example if the characters running frame was in frame 2 of the movie clip, then something like this would work:

Code:
onClipEvent(enterFrame) {
  if(Key.isDown(Key.RIGHT)) {
    _x += 5;
    this.gotoAndStop(2);
  }
  if(Key.isDown(Key.LEFT)) {
    _x -= 5;
    this.gotoAndStop(2);
  }
}


Thu Jan 29, 2009 9:49 am
WWW
Display posts from previous:  Sort by  
 [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software for PTF.