A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: cant make platforms move up and down!!

  1. #1
    Junior Member
    Join Date
    Oct 2003
    Posts
    26

    cant make platforms move up and down!!

    okay well yes i did make my platform move up and down but when the hero jumps on it he falls right through it like it isnt even there.. i have this code in the platform


    onClipEvent (load) {
    velocity = 3;
    }
    onClipEvent (enterFrame) {
    var y;
    y = _y-velocity;
    if (y>260 || y<105) {
    velocity = velocity*-1;
    }
    _y = _y-velocity;
    }
    and this code on the frame of the platform
    maxPlatforms = 0;
    for (i in this) {
    if (typeof (eval(i)) == "movieclip" && substring(i, -10, 5) == "platf") {
    maxPlatforms++;
    }
    }
    stop();

  2. #2
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    I have no idea what the platform frame code is suppose to do, but I suppose it doesnt affect any way the problem of your hero falling through it.

    Maybe its better, if you post the hitTest code you have, where your hero is testing if he is on the platform.

  3. #3
    Russ
    Join Date
    Jun 2002
    Posts
    148
    Maybe they forgot to even do HitTest.

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