-
Hey there !
here is my game: http://www.geocities.com/dj_zombie02/game.swf no preloader :( Size(252 KB)
i want to use SPACE as a jump ..i dont know how to do it and when the stickman get's to the end of that foot path he stays in the air ..i want him to fall heh :)
here is the script!
// frames:
// -
// straight
// right
// left
// straight-right
// straight-left
// right-run1
// right-run2
// right-run3
//
//
// actions:
// -
// turn-right
// turn-left
// run-right
// run-left
// stop-run
onClipEvent (load) {
frame = "straight";
action = "turn-right";
}
onClipEvent (enterFrame) {
if (action != "none") {
// TURNING
if (action == "turn-right") {
if (frame == "straight-right") {
frame = "right";
action = "none";
} else if (frame == "straight") {
frame = "straight-right";
} else if (frame == "straight-left") {
frame = "straight";
} else if (frame == "left") {
frame = "straight-left";
} else {
action = "none";
}
}
if (action == "turn-left") {
if (frame == "straight-left") {
frame = "left";
action = "none";
} else if (frame == "straight") {
frame = "straight-left";
} else if (frame == "straight-right") {
frame = "straight";
} else if (frame == "right") {
frame = "straight-right";
} else {
action = "none";
}
}
// RUNNING
if (action == "run-right") {
if (frame == "right-run3") {
frame = "right-run2";
this._x += 9;
} else if (frame == "right-run2") {
frame = "right-run3";
this._x += 9;
} else if (frame == "right-run1") {
frame = "right-run2";
this._x += 9;
} else if (frame == "right") {
frame = "right-run1";
this._x += 5;
}
}
if (action == "run-left") {
if (frame == "left-run3") {
frame = "left-run2";
this._x -= 9;
} else if (frame == "left-run2") {
frame = "left-run3";
this._x -= 9;
} else if (frame == "left-run1") {
frame = "left-run2";
this._x -= 9;
} else if (frame == "left") {
frame = "left-run1";
this._x -= 5;
}
}
if (action == "stop-run") {
if (frame == "right-run3") {
frame = "right-run2";
this._x += 9;
} else if (frame == "right-run2") {
frame = "right-run1";
this._x += 5;
} else if (frame == "right-run1") {
frame = "right";
action = "none";
} else if (frame == "left-run3") {
frame = "left-run2";
this._x -= 9;
} else if (frame == "left-run2") {
frame = "left-run1";
this._x -= 5;
} else if (frame == "left-run1") {
frame = "left";
action = "none";
} else {
action = "none";
}
}
this.gotoAndStop(frame);
}
}
onClipEvent (keyDown) {
if (Key.isDown(Key.RIGHT)) {
if (action == "none") {
if (frame == "left") {
action = "turn-right";
}
if (frame == "right") {
action = "run-right";
}
}
if (action == "turn-left") {
action = "turn-right";
}
} else if (Key.isDown(Key.LEFT)) {
if (action == "none") {
if (frame == "right") {
action = "turn-left";
}
if (frame == "left") {
action = "run-left";
}
}
if (action == "turn-right") {
action = "turn-left";
}
}
}
onClipEvent (keyUp) {
if (!Key.isDown(Key.RIGHT)) {
if (action == "run-right") {
action = "stop-run";
}
}
if (!Key.isDown(Key.LEFT)) {
if (action == "run-left") {
action = "stop-run";
}
}
}
-
That just takes me to a Yahoo error page
-
hmmm...i see ...
i'll try and fix that
-
-
-
ED_Mack it's working for me and every1 else ...
hmmm
try it now ... http://www.geocities.com/dj_zombie_game/game.swf
-
here is my game: http://www.geocities.com/dj_zombie_game/game.swf no preloader Size(252 KB)
i want to use SPACE as a jump ..i dont know how to do it and when the stickman get's to the end of that foot path he stays in the air ..i want him to fall heh
here is the script!
// frames:
// -
// straight
// right
// left
// straight-right
// straight-left
// right-run1
// right-run2
// right-run3
//
//
// actions:
// -
// turn-right
// turn-left
// run-right
// run-left
// stop-run
onClipEvent (load) {
frame = "straight";
action = "turn-right";
}
onClipEvent (enterFrame) {
if (action != "none") {
// TURNING
if (action == "turn-right") {
if (frame == "straight-right") {
frame = "right";
action = "none";
} else if (frame == "straight") {
frame = "straight-right";
} else if (frame == "straight-left") {
frame = "straight";
} else if (frame == "left") {
frame = "straight-left";
} else {
action = "none";
}
}
if (action == "turn-left") {
if (frame == "straight-left") {
frame = "left";
action = "none";
} else if (frame == "straight") {
frame = "straight-left";
} else if (frame == "straight-right") {
frame = "straight";
} else if (frame == "right") {
frame = "straight-right";
} else {
action = "none";
}
}
// RUNNING
if (action == "run-right") {
if (frame == "right-run3") {
frame = "right-run2";
this._x += 9;
} else if (frame == "right-run2") {
frame = "right-run3";
this._x += 9;
} else if (frame == "right-run1") {
frame = "right-run2";
this._x += 9;
} else if (frame == "right") {
frame = "right-run1";
this._x += 5;
}
}
if (action == "run-left") {
if (frame == "left-run3") {
frame = "left-run2";
this._x -= 9;
} else if (frame == "left-run2") {
frame = "left-run3";
this._x -= 9;
} else if (frame == "left-run1") {
frame = "left-run2";
this._x -= 9;
} else if (frame == "left") {
frame = "left-run1";
this._x -= 5;
}
}
if (action == "stop-run") {
if (frame == "right-run3") {
frame = "right-run2";
this._x += 9;
} else if (frame == "right-run2") {
frame = "right-run1";
this._x += 5;
} else if (frame == "right-run1") {
frame = "right";
action = "none";
} else if (frame == "left-run3") {
frame = "left-run2";
this._x -= 9;
} else if (frame == "left-run2") {
frame = "left-run1";
this._x -= 5;
} else if (frame == "left-run1") {
frame = "left";
action = "none";
} else {
action = "none";
}
}
this.gotoAndStop(frame);
}
}
onClipEvent (keyDown) {
if (Key.isDown(Key.RIGHT)) {
if (action == "none") {
if (frame == "left") {
action = "turn-right";
}
if (frame == "right") {
action = "run-right";
}
}
if (action == "turn-left") {
action = "turn-right";
}
} else if (Key.isDown(Key.LEFT)) {
if (action == "none") {
if (frame == "right") {
action = "turn-left";
}
if (frame == "left") {
action = "run-left";
}
}
if (action == "turn-right") {
action = "turn-left";
}
}
}
onClipEvent (keyUp) {
if (!Key.isDown(Key.RIGHT)) {
if (action == "run-right") {
action = "stop-run";
}
}
if (!Key.isDown(Key.LEFT)) {
if (action == "run-left") {
action = "stop-run";
}
}
}
-
can any1 help???
i made this script
if (action == "jump") {
if (frame == "jump3") {
frame = "jump2";
this._y += 9;
} else if (frame == "jump2") {
frame = "jump3";
this._y += 9;
} else if (frame == "jump1") {
frame = "jump2";
this._y += 9;
} else if (frame == "jump") {
frame = "jump1";
this._y += 5;
}
}
onClipEvent (keyUp) {
if (!Key.isDown(Key.SPACE)) {
if (action == "jump1") {
action = "stop-jump1";
}
}
}
but it's not working ..i dont relli know AC
so can any1 help ????
-
-
so can anyyyy1 helppppppp ??????
-
onClipEvent (keyUp) {
if (!Key.isDown(Key.SPACE)) {
if (action == "jump1") {
action = "stop-jump1";
}
}
}
This will always be true, as if the keys up, then space couldn't be down.
-
check out mad-sci tutorials on his website
http://www.freewebz.com/savco/site.htm
hope that helps
cia:D
-