A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 24

Thread: RPG help! i am only 12

  1. #1
    Senior Member
    Join Date
    Apr 2001
    Posts
    257
    Hello i am making a RPG(Role Playing Game) in a birds eye view just like GEN-TRAP by SUBWAY but i cannot make the man walk right i have:
    1) a movie clip of a man facing left walking
    2) a movie clip of a man facing right walking
    3) a movie clip of a man facing up walking
    4) a movie clip of a man facing down walking
    5) a movie in frame 1 a still left man with stop action
    frame 2 a still right man with stop action
    frame 3 a still up man with stop action
    frame 4 a still down man with stop action
    frame 5 the left movie with stop action
    frame 6 the right movie with stop action
    frame 7 the up movie with stop action
    frame 8 the down movie with stop action

    6) i have this very big movie (the 8 framed one) on scene 1 with the action script:

    onClipEvent (enterFrame) {
    if (Key.isDown(Key.LEFT)) {
    tellTarget (_root.man.left) {
    this._x = this._x-5;
    nextFrame ();
    }
    }
    }
    onClipEvent (enterFrame) {
    if (Key.isDown(Key.RIGHT)) {
    tellTarget (_root.man.right) {
    this._x = this._x+5;
    nextFrame ();
    }
    }
    }
    onClipEvent (enterFrame) {
    if (Key.isDown(Key.UP)) {
    tellTarget (_root.man.up) {
    this._y = this._y-5;
    nextFrame ();
    }
    }
    }
    onClipEvent (enterFrame) {
    if (Key.isDown(Key.DOWN)) {
    tellTarget (_root.man.down) {
    this._y = this._y+5;
    nextFrame ();
    }
    }
    }
    but it does not work very well HELP PLEASE!!!!!

    p.s. cheak out my last game i made based on MAD-SCI's tut at http://www.homemadegames.f2s.com/platform.html
    there is now 2 levels

    i may only be 12 but i am very good in flash 5

  2. #2
    Senior Member
    Join Date
    Feb 2001
    Posts
    314
    Originally posted by Veryevil
    but it does not work very well HELP PLEASE!!!!!

    "does not work very well" is a little vague. What is it that you aren't satisfied with?

    Since you say it's not working very well, I get the impression that it is somewhat working.

    Is the movement too choppy? (Try increasing the framerate and decreasing the amount he moves each frame.)

    Is it too slow? (Increase the framerate or increase the amount he moves each frame.)

    Is it not playing the animation when it moves? Does it not stop playing the animation when you stop moving? Does it stop moving when you release the key? What's the problem with it?

    Be a little more specific, and we might be able to help you figure this out.

  3. #3
    Senior Member
    Join Date
    Mar 2001
    Posts
    184
    hey veryevil im not even 12 yet im about to be on the 27th

  4. #4
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    ok so if I get it right you have 1 big movie with 8 frames each frame displayes different animation either still or walk. the seccond layer basicaly has only stop actions. what you have to do is:

    1) name all frames like: walk_left, still_right etc. etc..

    2) get the actions of the big movie clip:

    onClipEvent (enterFrame) {
    if (Key.isDown(Key.LEFT)) {
    this.gotoAndPlay("play_left");
    this._x = this._x-5;
    }
    }

    if your movie is strictly top-down, you can use only 2 nested clips. hero still and hero walk. then simply on key down play the hero walks and use _rotation for direction. on key up event play hero_still with the same _rotation so he will face the currant dir..

    mad_sci

  5. #5
    Senior Member
    Join Date
    Mar 2001
    Posts
    292
    hey, im 13, and i didn't know that every one on the FK boards are so young! i thought that they were all like 35 year olds living in thier parents basements . any who, im making an rpg also, only its more of an action based thing, called GANGSTA'. its not even close to done, im working on the engine right now.what i did is a scroller. i was gonna post a question, but i saw your post and i just fixed that in my game. what i did, is i made 1 MC. another is all the bg and obsticles. heres the code i put on the HERO: im gunna do it in another post(its wicked long)

  6. #6
    Senior Member
    Join Date
    Mar 2001
    Posts
    292
    onClipEvent (keyDown) {
    if (Key.isDown(Key.DOWN)) {
    tellTarget (this) {
    gotoAndPlay ("d");
    }
    }
    if (Key.isDown(Key.UP)) {
    tellTarget (this) {
    gotoAndPlay ("u");
    }
    }
    if (Key.isDown(Key.RIGHT)) {
    tellTarget (this) {
    gotoAndPlay ("r");
    }
    }
    if (Key.isDown(Key.LEFT)) {
    tellTarget (this) {
    gotoAndPlay ("l");
    }
    }
    }
    onClipEvent (keyUp) {
    if (!Key.isDown(Key.UP)) {
    if (!Key.isDown(Key.DOWN)) {
    if (!Key.isDown(Key.LEFT)) {
    if (!Key.isDown(Key.RIGHT)) {
    tellTarget (_root.hero) {
    gotoAndStop (1);
    }
    }
    }
    }
    }
    }


    ok, its long, but not too complicated. what i did, is mad emy movie so i could put as many animations in each direction as i want, with out having to mass with all the coding. i made the frames:
    1) stop and stoped person.
    2)labled "L" facing left
    3)secon part to L with a go to and play "L" action
    4)
    5)
    6) }all of them fallow the some format as 2 and 3
    7)
    8)
    9)

    it is not really as complicated as it sounds/looks.
    i made it like that so i could put shooting animations in there and so-on. if you want the coding so the "hero" doesn't go through walls, just ask.

  7. #7
    Senior Member
    Join Date
    Mar 2001
    Posts
    292
    ok, a last few things. if you want char.-sets go to
    http://www.rmdownloads.com/
    and i thought i might take advantage of this post by askign how to:
    -make my guy shoot a tommy gun with dup. MC method and in dif. dir.

    and i also think that you made an awesome platform game.

  8. #8
    Senior Member
    Join Date
    May 2001
    Posts
    425
    I'm only 15. well tomorrow anyways. I'm making one similar to Diablo 2. check it out in about a month.

  9. #9
    Junior Member
    Join Date
    Apr 2001
    Posts
    10

    1 question...

    hi Veryevil, jonbetter,

    can i ask you guys one question?

    can you guys publish your fla into swf and then run it using a standalone player?
    or convert it into a working *.exe?

    i have a game using these key.UP, key.DOWN thingy but won't function using a standalone player. i'm wondering if it's just me.

  10. #10
    Senior Member
    Join Date
    Apr 2001
    Posts
    257

    wow thanks

    thanks i didn't think you would be so young!!! ok i have taken jonbetter's idea and it works just fine except for one thing every time you let go of a key it makes you face down this is my code:

    onClipEvent (enterFrame) {
    if (Key.isDown(Key.LEFT)) {
    this.gotoAndPlay("walk_left");
    this._x = this._x-5;
    }
    }
    onClipEvent (keyUp) {
    if (!Key.isDown(Key.LEFT)) {
    tellTarget (_root.man) {
    gotoAndStop ("still_left");
    }
    }
    }
    onClipEvent (enterFrame) {
    if (Key.isDown(Key.RIGHT)) {
    this.gotoAndPlay("walk_right");
    this._x = this._x+5;
    }
    }
    onClipEvent (keyUp) {
    if (!Key.isDown(Key.RIGHT)) {
    tellTarget (_root.man) {
    gotoAndStop ("still_right");
    }
    }
    }
    onClipEvent (enterFrame) {
    if (Key.isDown(Key.UP)) {
    this.gotoAndPlay("walk_up");
    this._y = this._y-5;
    }
    }
    onClipEvent (keyUp) {
    if (!Key.isDown(Key.UP)) {
    tellTarget (_root.man) {
    gotoAndPlay ("still_up");
    }
    }
    }
    onClipEvent (enterFrame) {
    if (Key.isDown(Key.DOWN)) {
    this.gotoAndPlay("walk_down");
    this._y = this._y+5;
    }
    }
    onClipEvent (keyUp) {
    if (!Key.isDown(Key.DOWN)) {
    tellTarget (_root.man) {
    gotoAndPlay ("still_down");
    }
    }
    }
    any ideas!! :EEK:

  11. #11
    Senior Member
    Join Date
    Mar 2001
    Posts
    292
    onClipEvent (keyUp) {
    if (!Key.isDown(Key.UP)) {
    if (!Key.isDown(Key.DOWN)) {
    if (!Key.isDown(Key.LEFT)) {
    if (!Key.isDown(Key.RIGHT)) {
    tellTarget (_root.hero) {
    gotoAndStop (1);
    }
    }
    }
    }
    }
    }
    this code at the bottum should make it so that it faces up if your first frame is facing down, i made mine just standing looking up for that one
    as for the FLA and SWF
    SWF:
    http://www.qubenetworks.com/~jonbett...GTA_engine.swf
    FLA
    http://www.qubenetworks.com/~jonbett...GTA_engine.zip
    there you go. the FLA and SWF are always changing, but not always on my web space.
    And about the shooting, SOME ONE GIVE ME AN ANSWER!!!!!
    PPPPPLLLLLLLLEEEEEEEEAAAAAAASSSSSSSSEEEEEEEE
    my engine needs that for the gun pick up, changing, shooting anim, and all that other good stuff!
    HHHEEEELLLLPPPP

  12. #12
    Senior Member
    Join Date
    Mar 2001
    Posts
    292
    oh yeah, ideas:
    make it so he can swing a sword.
    if you dont figure it out, heres a few hints
    -make one walk frame walk and on with a sword swing mc(1 for each dir.)
    -make the sword its own MC
    -make an enemy
    -under the sword if (hitTest(_root.enemy)) tell target enemy go to and stop 2.
    -in frame 2, make the MC of death anim. like a head falls of ond you lower the alpha a little bit each frame(alpha is under instance, then effects)
    voila, instant decapitating death machine!

  13. #13
    Senior Member
    Join Date
    Apr 2001
    Posts
    257
    Jonbetter that wont work i have 4 still movies for each direction so if left is let go it must go to still_left and the same for the rest thanks for the help though

  14. #14
    Senior Member
    Join Date
    Apr 2001
    Posts
    168

    Smile GTA...

    Hey! Jonbetter. I like the GTA engine you made!!! I'm making a game using my own engine... It was gonna' be for a GTA clone and had friction n' stuff, but I adapted it for RPGs. Might take a while to load:

    http://rdesign.250x.com/stab.swf

    Tell me what you think.

  15. #15
    Senior Member
    Join Date
    Mar 2001
    Posts
    292
    that's pretty good wavyvirus, but you cna't stab alot of people, only the teacher. good consept though, school terrorization.
    i need some help loading variables. if i set a variable, then want to check it in an "If" command line, how do i do it?

  16. #16
    Senior Member
    Join Date
    Apr 2001
    Posts
    257

    tables

    i need to know how to stop my man(_root.man) form not walking through my table(_root.table) what would the code be

  17. #17
    Senior Member
    Join Date
    May 2001
    Posts
    425
    put this in the table:

    code:
    if (hitTest(_root.hero)) {
    movement = false;
    }

    then in your hero movie, make the motions in an "if" statement with movement
    if (movement == true){}

    then on your first frame:

    code:
    movement = true;

    there might be a simpiler way, but i dont know it

  18. #18
    Senior Member
    Join Date
    Apr 2001
    Posts
    257

    no

    sorry but that did not work

  19. #19
    Senior Member
    Join Date
    Mar 2001
    Posts
    292
    this is how its done:
    -you have your hero
    -you have your scrolling bg
    -you have you r_root.bg.table (the table)
    -you have your guy surronded with 4 MC's
    -you have your left, right, up, down
    -each of them have those instance names
    -your sides stay the same no matter what rotation
    -your sides are invisable (i think)
    -you have these actions on the bg mc:
    onClipEvent (keyDown) {
    if (!_root.area.build.hitTest(_root.hero.right)) {
    if (key.isDown(key.RIGHT)) {
    this._x -= 5;
    }
    }
    if (!_root.area.build.hitTest(_root.hero.down)) {
    if (key.isDown(key.DOWN)) {
    this._y -= 5;
    }
    }
    if (!_root.area.build.hitTest(_root.hero.up)) {
    if (key.isDown(key.UP)) {
    this._y += 5;
    }
    }
    if (!_root.area.build.hitTest(_root.hero.left)) {
    if (key.isDown(key.LEFT)) {
    this._x += 5;
    }
    }
    }
    thats how its done(the "!" is for seeing if it is not true).
    any questions?
    oh yeah, happy b-day anti-matter
    [Edited by jonbetter on 05-20-2001 at 04:11 PM]

  20. #20
    Senior Member
    Join Date
    May 2001
    Posts
    425
    thanks jonbetter.
    that seems like a complicated script.
    why dont you just figure out the edges of the hero?

    top_edge=this._y-(this._y/2)

    and the same with the other sides. this is how mad-sci did it, but he only did it with the bottom edge.
    then instead of te 4 MCs around the guy, make it say if the table is >=top edve <=bottom edge and so forth.

    mabey this isnt easier, but that what i would do

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