User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 12 of 12

Thread: Determining which side of platform Player collides with

  1. #11
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nifflas
    Your widgets blow my mind ( beside the Bounce Ball widget i also had a look at the Basic Movement widget ). It will take me some time to fully understand those widgets, they look pretty advanced. What i think i understand from the Bounce Ball movement is that it enters a fast-loop which slowly moves the object towards its new possition ( is this interpolation maybe? ) with collition detection along the way.
    Seing that i want to use my platform movement for both Player and Enemys, im not sure a large amount of fast-loops are desireable.

    I have however found a solution ( in theory ) which does not involve loops or fast-loops, which i present further down in the post
    It is also very comforting to hear i shouldnt worry about this too much, though i might sometime im not about to give up just yet
    ...
    Gkinfinity
    I dissagree that Jacobs method solvs my problem
    But before i reject it completly let me see if i have understood it correctly

    Before Object ( Blue square ) moves it goes through a short loop or process where it ( Object ) is moved '1 pixle' in all four directions ( left, up, right, down ) like this

    Have i missed anything or am i understanding the method correctly?
    ...
    I mentioned i had some half baked ideas on how to solv this before, and i have indeed found a solution ( in theory ) of how to solv this issue ( topic ) without going through numerous loops

    When my objects ( Player and Enemies ) move, they move in a line from point A to point B

    Before player moves it stores its X Y coordinates in alt values.
    When Player overlaps an Obstacle, it needs to check in what area ( relative to the obstacle ) it was 'previously' possitioned in ( see illustration below )

    Off cource this means that when Player overlaps with an Obstacle, the program checks 8 conditions whereof 1 will trigger ( based on Players previous position )

    The conditions for the center areas ( when Players previous position is in one of the center areas ) are easy because Player always moves in a straight line from A to B

    On overlap + if Player previously was in 'top center' area --->
    - Player collides with top of Obstacle
    On overlap + if Player previously was in 'bottom center' area --->
    - Player collides with bottom of Obstacle
    On overlap + if Player previously was in 'left center' area --->
    - Player collides with left of Obstacle
    On overlap + if Player previously was in 'right center' area --->
    - Player collides with right op Obstacle

    The problematic part is when Players previous position is in one of the corner areas ( top left, top right, bottom left, bottom right )
    ...
    I have however found a solutio for this, illustrated in an .mfa attachment at the bottom of the post ( i wont go further intoo how i figured it out, but feel free ta ask ).

    When Players previous position is in one of the corner areas, i simply calculate the volume ( in pixles ) of two specific square areas ( based on Players current possition, previous possition, and corner position of Obstacle ).
    I then compare the volume of those two areas to determine which is bigger.

    I have attached an example file which illustrates how the volume of the two areas are calculated, for a collotion originating from the top left area of the Obstacle.

    On overlap + If volume of area1 ( green area ) is greater than volume of area2 ( purple area ), its a top collition.
    On overlap + If volume of area2 ( purple area ) is greater than volume of area1 ( green area ), its a left collition.
    ...
    Im no expert, but I persoally belive this solution will work and is a better than a solution which move all objects ( Player and Enemies ) slowly using loops for currect collition detection ( resulting in lots of fast-loops per frame when having lots of enemies ).
    My solution ( mentioned above ) calculate two values and compare them ( in 4 out of 8 possible situations ) which result in precice collition detection ( working for square objects ).
    Attached files Attached files

  2. #12
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    With Jacob's solution, you can get results such that both "Overlap Top" and "Overlap Right" are equal to 1, etc.

    It will work for all 8 directions that way.

Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. Move player while he's on a moving platform?
    By BartekB in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 19th November 2013, 04:25 PM
  2. Bug in drag and drop system when collides?
    By paobrasil in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 5th September 2012, 12:12 AM
  3. Moving Platform doesn't seem to like Player (^-^;)
    By Raylax in forum Multimedia Fusion 2 - Technical Support
    Replies: 16
    Last Post: 15th February 2009, 09:23 PM
  4. Platform game - set player's angle
    By salamander in forum The Games Factory 2 - Technical Support
    Replies: 4
    Last Post: 15th September 2008, 05:04 AM
  5. Pls help with collides with backdrop problem
    By Jaeu in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 3rd August 2006, 11:15 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
  •