A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: Game test...and need help!

  1. #1

    Thumbs up

    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";
    }
    }
    }

  2. #2
    Gross Pecululatarian Ed Mack's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    2,954
    That just takes me to a Yahoo error page

  3. #3
    hmmm...i see ...
    i'll try and fix that

  4. #4

  5. #5
    Gross Pecululatarian Ed Mack's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    2,954
    Nope, doesn't work.

  6. #6

    Thumbs up

    ED_Mack it's working for me and every1 else ...
    hmmm
    try it now ... http://www.geocities.com/dj_zombie_game/game.swf


  7. #7
    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";
    }
    }
    }

  8. #8
    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 ????

  9. #9
    AC=AS= action script

  10. #10
    so can anyyyy1 helppppppp ??????

  11. #11
    Gross Pecululatarian Ed Mack's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    2,954
    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.

  12. #12
    incredibulus-actionscriptum magnetos's Avatar
    Join Date
    May 2001
    Posts
    2,160
    check out mad-sci tutorials on his website

    http://www.freewebz.com/savco/site.htm

    hope that helps
    cia

  13. #13
    ok ..thx i'll try that

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center