A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [help] platforms above platforms

Hybrid View

  1. #1
    Senior Member
    Join Date
    Jan 2003
    Location
    Austin, TX
    Posts
    297

    [help] platforms above platforms

    alright, so I'm using the "coordinate rotation" algorithm posted here a while ago by bit101, I added some friction, etc, and got it working pretty well.

    unfortunately (and this was an inherent problem that I knew I had to face eventually from the beginning) the way I choose which platform to test a collision against is to see at the very beginning which platform the hero is on top of, and from then on, if he moves left of it, keep checking platforms one to the left until you find the right one, and same with the right. all the platforms are in an array sorted by their _x attribute.

    obviously, I run into a problem once I add a platform above another.

    does anyone know how to get around this problem, or should I abandon my platform-array choosing algorithm altogether? if so, what's a better way to determine which platform to check collision against, so I don't have to check collision against every platform on every frame?
    Attached Files Attached Files

  2. #2
    Banned
    Join Date
    Dec 2006
    Posts
    43
    Is your problem with the jumping

  3. #3
    Banned
    Join Date
    Dec 2006
    Posts
    43
    Is your problem with the jumping?

  4. #4
    Senior Member
    Join Date
    Jan 2003
    Location
    Austin, TX
    Posts
    297
    no... the way the program chooses which platform (a single instance of a movie clip that only contains a line) to test against is it checks to see if the hero is between its two ends (it, not physically but mathematically, rotates the coordinates of the hero and the platform so that the platform is flat, and makes sure the hero is between its left and right ends). If it is left of the line, it repeats the process on the "line to the left" (actually, the line that is one index lower in the array holding all the platforms), and same if it's on the right.
    unfortunately, the way the array is sorted is according to the platforms' _x attributes, so adding a platform on top of another will put that top platform inbetween the platforms below it in the arrow and mess everything up.


    oh yeah... just noticed the jumping actually. I'll fix that really quick, thanks

  5. #5
    Senior Member
    Join Date
    Jan 2003
    Location
    Austin, TX
    Posts
    297
    this should fix the jumping issue

    and by "arrow" in the last post I meant "array" =\
    Attached Files Attached Files
    Last edited by bluekronos; 03-24-2007 at 08:57 PM.

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