User Tag List

Results 1 to 8 of 8

Thread: Obstacles collision

  1. #1
    No Products Registered

    Join Date
    Jul 2008
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Obstacles collision

    I have a question and I am hoping someone can help me. I checked out the platforming tutorial by David Newton. In this case I see that the collision is taken care when the object overlap with the back drop.

    One part that I need in the tutorial is the part where the player is stopped when they run to obstacles. The even editor that he wrote is

    + On loop "horiz"
    + Player is overlapping Group.Doors
    -> Set X position of Player to X("Player") - (Horiz("Player")/ABS(Horiz("Player")))
    -> Position the detector directly below the player
    -> Set Horiz("Player") to 0
    -> Stop loop "horiz"

    Problem that I found is that this only works when the player object movement type is static. I am making a platforming game where the player will always move to the right and the player only control the jump button to avoid the obstacles and getting left out from the screen.

    In the tutorial program, I changed the movement type to bounce to the right with the speed of 10 and the player just went through the wall but if I changed the object to static and move it manually with joystick or keyboard, it will be stopped by the wall. I want the player can still move when it jumps even after it is stucked behind the obstacles.

    I hope someone can clear this out for me
    Thank you


  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Obstacles collision

    Rather than adding a different movement on top of the platform engine, you can add a bit on to the existing events to get your constant movement to the right - that's the nice thing about entirely custom movements! It's possible to combine them, but it's rather difficult to get your head round if you have to contend with more than one at once.

    What you need to do here is, instead of allowing the player to control the horizontal movement (all the "Player is holding key Left/Right" events in the tutorial), replace them simply with "Always -> Set Horiz("Player") to 4". This will give you a constant movement right at four pixels per frame - experiment to get the rate that suits your game.

  3. #3
    No Products Registered

    Join Date
    Jul 2008
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Obstacles collision

    I will try that. Thank you!

  4. #4
    No Products Registered

    Join Date
    Jul 2008
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Obstacles collision

    I tried it last night, it works really well in the obstacles collision but the problem is that the movement of the characters becomes awkward because it is moving frame by frame. The game becomes skipping for every movement of the character. I decided to use bouncing movement to the right and it moves smoothly but the problem is that I have to create my own obstacles (using invisible active object) instead of using the back drop. I still like how you handle the object collision better honestly but the skipping really bugs me everytime the character moves. Do you know how to get rid of the skipping?

  5. #5
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Obstacles collision

    Can you describe what you mean by "skipping" (maybe put an example up in the File Archive)?

  6. #6
    No Products Registered

    Join Date
    Jul 2008
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Obstacles collision

    OKay, I have put the file into the file archive with the same header (Obstacle collision).

  7. #7
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Obstacles collision

    It took a while for me to notice it, but the "skipping" action you're seeing comes from the way that the chicken sprite doesn't stay in the same position all the time - it has an animation of hopping up and down, and this interferes with detecting whether it's actually colliding with the platform or not, producing this odd stop-start movement. If you jump, you'll notice that the movement is smooth in the air.

    To stop this from happening, the quickest way is to uncheck the chicken objects' "Use fine detection" properties. This will make collision events detect the object when any part of it - not just the non-transparent pixels - collide with anything else, so you may want to reduce the box that they're drawn in a bit.

  8. #8
    No Products Registered

    Join Date
    Jul 2008
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Obstacles collision

    oh...Thank you so much! It works so well now. Thanks once again!

Similar Threads

  1. Moving obstacles
    By MFjeldet in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 17th October 2011, 02:07 AM
  2. obstacles and layers
    By ac3raven in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 1st June 2011, 06:00 AM
  3. Obstacles collision
    By GloriousIntruder in forum File Archive
    Replies: 1
    Last Post: 28th August 2008, 03:36 PM
  4. Scrolling and obstacles
    By Heetu in forum The Games Factory 2 - Technical Support
    Replies: 0
    Last Post: 17th October 2006, 10:11 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
  •