A Flash Developer Resource Site

Page 4 of 11 FirstFirst 12345678 ... LastLast
Results 61 to 80 of 211

Thread: [Resolved] PLATFORM TUTORIAL.....

  1. #61
    Senior Member
    Join Date
    Mar 2001
    Posts
    292
    im also working on a fighting game. it is pretty bad, though. i have found that you dont really need to use all of the platform scripting. i made it 2 player so you dont have to do any complicated AI junk. one cool easy little thing to do is make life percentage things. this is the code i have:

    onClipEvent (keyDown) {
    if (hitTest(_root.p2.p2fist)) {
    _root.p1life -= 10;
    }
    if (key.isDown(Key.SHIFT)) {
    tellTarget ("_root.p1") {
    gotoAndPlay (4);
    }
    }
    if (key.isDown(Key.RIGHT)) {
    tellTarget ("_root.p1") {
    gotoAndStop (2);
    }
    tellTarget ("_root.p1") {
    _root.p1._x += 15;
    }
    }
    if (key.isDown(Key.LEFT)) {
    tellTarget ("_root.p1") {
    gotoAndStop (3);
    }
    tellTarget ("_root.p1") {
    _root.p1._x -= 15;
    }
    }
    }

  2. #62
    Senior Member
    Join Date
    Mar 2001
    Posts
    184

    Smile

    thanks man i started a bit of ai.

  3. #63
    Senior Member
    Join Date
    Jan 2001
    Posts
    361
    Hello again, I need a code that will make it so that when all of my life runs out it goes to a game over screen? so far I have all the enimies and life metor and stuff, my coding so far is

    onClipEvent (enterFrame) {
    if (hitTest(_root.hero)) {
    _root.life -= 1;
    }
    }
    Thanks, and esspecially to Mad Sci for putting together this great tut! p.s. how do you do smilies!

  4. #64
    Senior Member
    Join Date
    Mar 2001
    Posts
    292
    i did a code on the life. my life meter was a MC with three ball graphics. the number of balls went don each time hero got hit. on the final frame, i told the root timeline to goto and play frame 2(which said game over)all you have to write on the last frame actions is this:
    gotoAndStop (2);

  5. #65
    Senior Member
    Join Date
    Jan 2001
    Posts
    361
    Thats a good idea but the reason I am using percentage is that whe an enemy hits my player it is very sensitve and one hit would take all three balls down is there a way I can make the hero so sensative?

  6. #66
    Senior Member
    Join Date
    Mar 2001
    Posts
    184
    what is the code for the a key becuase there are only a few keys that are already preset

  7. #67
    Senior Member
    Join Date
    Mar 2001
    Posts
    184
    how do you make it minus one ball each time you get hit

  8. #68
    Senior Member
    Join Date
    Jul 2000
    Posts
    107

    hello

    hello im trying to make a scrolling
    version of this game, something like the robbie williams game but it's not happening
    the ball movie clip just goes to the top of the movieclip and keeps falling, can someone help


  9. #69
    Senior Member
    Join Date
    Mar 2001
    Posts
    292
    To make balls disappear, you first have to make a MC with the variable name "life" (without the quotes). then, inside that clip, you make 3 balls on the first frame. give the frame a stop action. then, in the second frame, give it only 2 balls with a stop action. on the next... you guessed it, 1 ball and a stop action. on the next frame, make it blank with these actions:

    tellTarget ("_root.hero") {
    gotoAndStop (2);
    }

    (you have to have a blank frame in the hero MC with a stop action.)

    to make the balls disappear when he gets hit...
    give the enemy, whatever it is, these actions:

    onClipEvent (enterFrame) {
    if (hitTest(_root.hero)) {
    tellTarget ("_root.life") {
    nextFrame ();
    }
    }
    }

    thats all.

  10. #70
    Senior Member
    Join Date
    Mar 2001
    Posts
    184
    how can i use other keys as buttons

    ill put the new version of my game on the net today

  11. #71
    Senior Member
    Join Date
    Mar 2001
    Posts
    292
    what exactly do you mean? do you mean do other keys? if you do that, its easy, but it will take a while for me to explain it to you. if you are in normal mode, go to the objects book, then the keys book. there are a few of the major keys to choose from. if you are not satisfied, you can type in the key code, instead of the Key.WHATEVER .
    i cannot say them all in this post, but if you ask for certain keys, i have a flash book thats lists them so i could tell you.

  12. #72
    Senior Member
    Join Date
    Jan 2001
    Posts
    361
    Here is an early version of my game it has one level info and please feel free to critise and change any problems!

    http://www.geocities.com/experimenta...tform_game.zip

  13. #73
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756

    ATTENTION ALL

    New ver. of the tutorial..

    1. improved speed
    2. some minor bugs fixed.
    3. jump tru plat not possible..
    4. 2 ladders..
    5. 1 pick item..

    using the laddres:

    ladder 1: non-restricted on top
    ladder 2. restricted on top..

    you can snap ladder 1 and on top ladder 2 to make one big ladder..or use ladder 1,,ladder1,,ladder2 for a realy big one..

    Ok let me know of any bugs Flash is acting strangely nowadays..

    mad_sci


    http://savco.virtualave.net/plat.zip

  14. #74
    Senior Member
    Join Date
    Mar 2001
    Posts
    184
    i want to use e s d x c v b n could you tell me the code for those thanks

  15. #75
    Senior Member
    Join Date
    Mar 2001
    Posts
    184
    hey mad sci can you tell me the code to make it so if the life variable reaches 0 a certain thing will happen.

  16. #76
    Senior Member
    Join Date
    Jan 2001
    Posts
    361
    Hey Kbomber I need the same thing! I f you Find it please tell me

  17. #77
    Senior Member
    Join Date
    Apr 2001
    Posts
    257

    i know how

    place a input text in your movie give it the variable name
    "_root.life" (no brackets) in the first main frame give it the action "life = 100" if 100 is your life, then make a MC have an empty keyframe in it with the frame actions

    if (_root.life <= 0) {
    tellTarget (_root) {
    gotoAndStop ("End", "end");
    }
    }

    so if _root.life = 0 it looks in the main movie and goes to (in this code) a scene called End with the frame lable end

    then put that in the same frame/scene as the input box called _root.life

  18. #78
    Senior Member
    Join Date
    Mar 2001
    Posts
    292
    E:69
    S:83
    D:68
    X:88
    C:67
    V:86
    B:66
    N:78
    voila!
    by the way MadSci, thanks for the ladders

  19. #79
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    I think that with this the tut. is over right..I mean we got the platforms, the ladders, the hero, and pick item..
    we also have jump, climb, walk..

    So whats next

    mad_Sci

  20. #80
    Senior Member
    Join Date
    Mar 2001
    Posts
    292
    well...
    i seem to have trouble making the enemys move. i put them inside a movie clip and use tweening. i have the hitTest coded to the enemy (so its looking for collision with the hero, not the other way around.) whats wrong with it?

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