Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

natatos

macrumors regular
Original poster
Dec 23, 2008
137
0
Iowa
I'm trying to make a fighting game in flash (if there is a better free program for doing this tell me) I'm still coding it but for the running I have a Movie Clip of a person walking but when I press the buttons they just move insteid of walk here is the code

Code:
onClipEvent(load){
    fight = false;
}
onClipEvent(enterFrame){
    if(fight == false){
        if(Key.isDown(Key.LEFT) && fight != true){
            this._x -= 4;//walk left..
            this._xscale = -100;
            this.gotoAndStop(2);
        }else if(Key.isDown(Key.RIGHT) && fight != true){ 
            this._x += 4;  //this ^ Walk right.
            this._xscale = 100;
            this.gotoAndStop(2);
        }else{
            this.gotoAndStop(1);
        }
    }           
         if(Key.isDown(Key.SPACE)){
            this.gotoAndStop(1);
            fight = true; 
        }
        if(this._currentframe == 1){
            fight = false;         
        }   
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.