A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: need help with leigt.2ya.com engine

  1. #1
    Senior Member tongue of colicab's Avatar
    Join Date
    Nov 2001
    Location
    The Netherlands
    Posts
    329

    need help with leigt.2ya.com engine

    Hi, Im building a platform game with the engine from www.leight.2ya.com. I figured out what most of the code does but there are some things I cant get to work.

    Problem one:

    I want to play a animation of, lets say the right arrow key is pushed. Now the code says:

    if (Key.isDown(Key.DOWN) && jumping == false) {
    dir = "duck";
    h.gotoAndStop("duck");
    jumping = false;
    xSpeed = 0;

    so I copy the code and paste it and change the names for the right arrow key. There are no errors in the code if flash checks it. But if I do this and press the right arrow button the graphic will change but for some reason it wont move :S

    problem two:

    The engine scrolls left to right, but how can I make it that it wil scroll up and down to if needed?

    problem three:

    The hittest wont work If i make a platform above the ground.

    Can someone help this p00r n00b?
    Attached Files Attached Files

  2. #2
    leight.com.au leight's Avatar
    Join Date
    Sep 2002
    Location
    australia
    Posts
    1,437
    hey! someone finally used my engine

    i just downloaded ur .fla. i rekkon you should use the other engine (one called 'optimised art scrolling'). that one has better hitTests and you can have levels that scroll forever and not effect the frame rate. the code is pretty much the same, except for a few changes to the scrolling.

    problem 1:
    1. u see the function 'heroMovement'. put this code in there
    Code:
    if (!Key.isDown(Key.LEFT)) {
            if (!Key.isDown(Key.RIGHT)) {
                if (!Key.isDown(Key.DOWN)) {
                    h.gotoAndStop("still");
                }
            }
        }
    make sure there is a frame called still.
    2. make a frame for left and right. put under the Key.isDown(Key.akey)
    h.gotoAndStop("theRightFrameLable")

    problem 2:
    i guess you would do it something like the horozontal scrolling.
    1. set the max and min Y variables.
    2. check if the hero has gone above or below them
    3. move the y axis.

    problem 3:
    what do u mean it wont work if u put a platform above the ground??? maby because you have to draw that in the solid part of the level as well - coz the hitTest isnt against what you see, its against another mc called 'solid'.

    hope it helps

    ps: damit! i been so long w/o fk that ive forgotten the actionscript thing. how do u do it again :blushes:
    Last edited by leight; 01-15-2004 at 05:51 PM.

  3. #3
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,227
    Originally posted by leight
    ps: damit! i been so long w/o fk that ive forgotten the actionscript thing. how do u do it again :blushes:
    its not you, the FK forums are messed up with the as and php tags. Hopefully will be fixed soon.

  4. #4
    Senior Member tongue of colicab's Avatar
    Join Date
    Nov 2001
    Location
    The Netherlands
    Posts
    329
    Leight I doesnt work, if i add the code and add the lines of code for wich frame it should play. If I press left it will play the left frame, but if I press duck it will also play the left frame. If I add the same code for the right frame it doesnt even plays the right frame if right is pressed. Altough it will play the right frame if i press duck

  5. #5
    leight.com.au leight's Avatar
    Join Date
    Sep 2002
    Location
    australia
    Posts
    1,437
    tonypa: thanks mate

    tongue of colicab: you just have everything mixed up. works perfectly for me. here is the .fla of the engine with animations and some simple graphics. if you need anymore help, my email and msn address is leightacb@hotmail.com

    hope it helps
    Attached Files Attached Files

  6. #6
    Senior Member tongue of colicab's Avatar
    Join Date
    Nov 2001
    Location
    The Netherlands
    Posts
    329
    Thanks leight. I now know what i did wrong. I put all the code for the animations in the same place instead of putting it under the move code for each button.

    Thank for helping me out, and I will sure email you if i need any help Do you have MSN?

  7. #7
    leight.com.au leight's Avatar
    Join Date
    Sep 2002
    Location
    australia
    Posts
    1,437
    np buddy,

    that .fla i attatched above, the scrolling is more correct than the one on my site. yeh i do have msn: leightacb@hotmail.com

    glad to help.

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