A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: A moving platform problem

  1. #1
    Junior Member
    Join Date
    Jan 2001
    Posts
    20
    Ok here is my thing, I'm working on a platform game right now and its going great exept for one thing.

    I can't get my moving platform to work properly.
    When the character lands on the platform the platform should take the character with it but its not doing that.
    The platform is in a MC and that MC is in the MC called background.

    When the character hits the platform for the first time it checks the Xposition of the platform and the background named "platformorg1" and "platformorg2" and then i do this
    ------------------------------------------------------------
    setProperty ("_root.Background", _x, _root.platformorg2 - (getProperty (this, _x )- _root.platformorg1));
    ------------------------------------------------------------
    Can anyone help me please?
    You can check the game on http://www.twisted.nl/dennisspace

    Oh by the way tell me what you think of it so far
    Thanks Chojin

  2. #2
    Junior Member
    Join Date
    Jan 2001
    Posts
    20
    By the way the arrowskeys are for moving,jumping and ducking
    and if you hold shift you can run faster

    That's it

  3. #3

    Very Bad A$$ !

    I like how well you have made the character move so life-like. I have the same problem as u with my game. I got it to almost work moving 1 way, but then i didn't know how to make it so that when the platform moves back the other way it would carry him in the right direction. i gave up for now & u gotta "walk" with the platform. how did u get your platform to move your character in the same direction as the platform? i am not that technical, but i am learning, so it is not always so obvious to me. i hope someone has the answer for both of us.

  4. #4
    Junior Member
    Join Date
    Jan 2001
    Posts
    20

    Question Re: Very Bad A$$ !

    Originally posted by sgtslaughter
    I like how well you have made the character move so life-like. I have the same problem as u with my game. I got it to almost work moving 1 way, but then i didn't know how to make it so that when the platform moves back the other way it would carry him in the right direction. i gave up for now & u gotta "walk" with the platform. how did u get your platform to move your character in the same direction as the platform? i am not that technical, but i am learning, so it is not always so obvious to me. i hope someone has the answer for both of us.
    Thanks i'm glad you like it of course the graphics are just temporary.
    About the character moving in the same direction. If you read my first part you'll see how i did.

    Another way to do this is by using a variable.
    Your moving platform is in a MC right now all you do is when it is starting to go right you set "_root.direction" to
    "1" when it starts to move left you set "_root.direction" to "2" now in your movementscript check if "_root.direction" = "1" or if it is "2" and put the correct scripting after it and voila it is done

    I would really like to see your game do you have a url where i can check it?

    Greetings Chojin

  5. #5
    Cool, i will try that out. Sorry for taking so long to reply, i am at work. I have the working version posted here:

    http://stephan.iserver.net/sgtslaughter/platformgame/

    As u will see, i made it based off of Mad-Sci's platform tutorial. that is why the hero is a ball. i have left him as a ball for now because i am designing a hero still & i wasn't sure how to make him animate correctly when he moves. Lemme know what u think. I even integrated a password into it so u can continue where u were later on & keep your score. basic object of game is to collect all of the triangles & then exit thru the door that opens before the time runs out. enjoy.

  6. #6
    Junior Member
    Join Date
    Jan 2001
    Posts
    20

    Wink

    All you do is when your keydown is left set _root.left to 1
    Now if _root.left is 1 play the correct animation make sure he does this only once or it wil repeat playing the first frame of that animation

    by the way you can make him turn around by setting the scale to 100 or -100

  7. #7
    Thanks for the tip. i already got him to work correctly yesterday using the code from this thread:

    http://board.flashkit.com/board/show...hreadid=165038

    I tweaked it a little bit for my game & it works perfectly. I am also using the xscale code instead of redoing alll the reverse animations. All i have to do now is settle on the hero's design.

    Did u get to try my game at all? How does it run on your machine? What kind of hardware does your computer have? I use a p3 750mHz 128mb RAM dell with 32mb video & i have no problems. But, my girlfriend's computer is a 4 yr old packard bell p1 233mHz with i think 16mb RAM (?) & it runs slooooow on most levels. I mainly designed it for newer computer anyways.

    Later.

  8. #8
    Senior Member
    Join Date
    Mar 2001
    Posts
    292
    sick game.

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