Monster Racer Rush
Select between 5 monster racers, upgrade your monster skill and win the competition!
4.18 / 5.00 3,534 ViewsBuild and Base
Build most powerful forces, unleash hordes of monster and control your soldiers!
3.80 / 5.00 4,200 ViewsHey, I'm making a platform style game (my 1st so I'm having a little trouble) and at the moment, I'm having trouble with movement. The player is not showing the animation for standing still when it stops jumping or moving, and instead, stops at the frame showing the last action.
If it would help find the problem, let me know and I'll post the AS
Thanks
-H
We can easily forgive a child who is afraid of the dark; the real tragedy of life is when men are afraid of the light.
-Plato
Suck it.
Oh, and I'm using actionscript 2 on Flash MX 2004 Professional (Don't know if it Matters)
-H
We can easily forgive a child who is afraid of the dark; the real tragedy of life is when men are afraid of the light.
-Plato
At 3/29/09 04:56 PM, SK8ninja wrote: "Simple AS help"
Exactly what I'm looking for.
I hope you realize how remarkably unhelpful that was.
We can easily forgive a child who is afraid of the dark; the real tragedy of life is when men are afraid of the light.
-Plato
if you're using the "if" statement, be sure to use "else" in conjunction with it.
onClipEvent(enterFrame){
if( Key.isDown(Key.RIGHT)){
gotoAndstop(1);
}else{
gotoAndStop(2);
}
}
in the case stated, frame 1 is where the moving animation would be, frame two where the idle animation is located.
We can easily forgive a child who is afraid of the dark; the real tragedy of life is when men are afraid of the light.
-Plato
We can easily forgive a child who is afraid of the dark; the real tragedy of life is when men are afraid of the light.
-Plato
y don't u just go to actions and copy +paste code?
No matter what your weaknesses are, make sure your own abilities supersede them.
I was under the impression that lengthy a code/post was obnoxious and frowned upon. Here goes:
onClipEvent (load) {
var speed:Number = 0;
var walk:Number = 3;
var run:Number = 6;
var grav:Number = 0;
var falling:Number = 0;
var jumped:Boolean = false;
var jumpHeight:Number = 25;
var touchingGround:Boolean = false;
var scale:Number = _xscale;
var doorOpened:Boolean = false;
var attacked:Boolean = false;
}
onClipEvent (enterFrame) {
if (!touchingGround ) {
grav++;
this._y += grav;
} else {
grav = 0;
}
if (_root.ground.hitTest(_x, _y, true)) {
touchingGround = true;
} else {
touchingGround = false;
}
if (!attacked) {
if (Key.isDown(65)) {
_x -= speed;
this.gotoAndStop(2);
_xscale = -scale;
} else {
gotoAndStop(1);
}
if (Key.isDown(68)) {
_x += speed;
this.gotoAndStop(2);
_xscale = +scale;
} else {
gotoAndStop(1);
}
if (Key.isDown(Key.SHIFT)) {
speed = run;
} else {
speed = walk;
}
}
}
onClipEvent (enterFrame) {
if (!attacked) {
if (jumped) {
falling += 0.5;
_y += falling;
if (touchingGround) {
jumped = false;
}
} else {
if (Key.isDown(87)) {
jumped = true;
falling = -jumpHeight;
this.gotoAndStop(3);
}
}
}
if ((Key.isDown(87)) and (Key.isDown(65))) {
this.gotoAndStop(3);
}
if ((Key.isDown(87)) and (Key.isDown(68))) {
this.gotoAndStop(3);
}
if ((!Key.isDown(87)) and (!touchingGround)) {
this.gotoAndStop(3);
} else if ((Key.isDown(87)) and (!touchingGround)) {
this.gotoAndStop(3);
}
if ((_currentframe == 3) and (touchingGround)) {
gotoAndStop(1);
}
}
onClipEvent (keyUp) {
gotoAndStop(1);
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.enemy)) {
_root.hp.health-1;
}
}
We can easily forgive a child who is afraid of the dark; the real tragedy of life is when men are afraid of the light.
-Plato