PDA

View Full Version : [AS1] Platform game help


Banana61
08-08-2004, 11:03 PM
hi I'm making a platform game and I need to know how can I make him move

and play the running animation and so if he was running left it will stop and

he'll be standing left if hes running right it will stop and he'll be standing right

please help

Laguana
08-09-2004, 06:12 AM
Have a look at

http://www.actionscript.org/tutorials/beginner/games_in_flash/index.shtml

and then try to apply some of your own logic to it, to get the kind of game that you want it to be.

Banana61
08-12-2004, 10:46 PM
hi i'm making a platform game and I 'm trying to get my main character to

move left and play the animation I made for left but when he stops it goes to

standing left and if he moves right it plays tha animation and if he stops he

facing left so far I have this It works until I ad the walking left and the stop looking right

onClipEvent(enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this._x += 5;
gotoAndStop("runR");
}else{
gotoAndStop("sr");
}
if(Key.isDown(Key.LEFT)) {
this._x -= 5;
gotoAndStop("runL");
} else {
gotoAndStop("sl");
}
}
dont send me to the tutorial at actionscript.com a lot of help that is

Laguana
08-13-2004, 06:22 AM
One thing that you could do, is instead of two seperate animations, you could have one animation and one stopping pose. Then you could use code like this

onClipEvent(enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this._x += 5;
this._xscale = 100
this.play();
} else if (Key.isDown(Key.LEFT)) {
this._x -= 5
this._xscale = -100
this.play()
} else {
this.gotoAndStop(1)
}
}

Which stops the person facing the direction they last faced, and it means less animating, as it just switches which way the character is facing.

Banana61
08-13-2004, 07:06 PM
thanx