User Tag List

Results 1 to 4 of 4

Thread: Jumping on enemy hurts player character. (Platformer game)

  1. #1
    Clicker Fusion 2.5 (Steam)Android Export Module (Steam)

    Join Date
    Dec 2015
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Jumping on enemy hurts player character. (Platformer game)

    Hello, everyone,

    I'm trying to have my player character jump on enemies to hurt them, but if it runs/walks into them, it will get hurt, like in a normal platformer.

    I've managed to get it so that the player character gets hurt and knocked back when walking into an enemy (a light blue box in my prototype) by following almighty zentaco's tutorial and I am currently trying to make it so that if the character jumps on an enemy, the enemy dies.

    I've managed to do that too by placing a narrow hitbox underneath the player character. However, when my player character jumps on an enemy, it gets hurt as well. And when it walks into an enemy, sometimes the knock back makes it so that the hitbox collides with the enemy, killing it in the process.

    I've included my prototype to show you what I mean. The lines of code in question in my prototype are 56 to 62 and I documented all of my steps as comments.

    Does anyone know how I make it so that running into enemies doesn't trigger the hitbox that destroys them and how I can jump on them without getting hurt in the process. Thank you very much.
    Attached files Attached files

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    aenever's Avatar
    Join Date
    Jun 2013
    Posts
    1,409
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    Hi GaoLi,

    The accuracy of collisions is what is causing your problem. If you isolate line 62, when the enemy is changed into an obstacle the player dips into the enemy and floats up. In other words the player health will always be triggered. I've added a line that the player and enemy y pos must be the same to get hurt

    Prototype3 fix.mfa

  3. #3
    Clicker Fusion 2.5 (Steam)Android Export Module (Steam)

    Join Date
    Dec 2015
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by aenever View Post
    Hi GaoLi,

    The accuracy of collisions is what is causing your problem. If you isolate line 62, when the enemy is changed into an obstacle the player dips into the enemy and floats up. In other words the player health will always be triggered. I've added a line that the player and enemy y pos must be the same to get hurt

    Prototype3 fix.mfa
    Thank you very much. That did indeed help, though now the player character sometimes jumps on the enemy and stays there and the enemy doesn't get hurt. I don't know if it's because of weirdly angled jumps the character can make. This is quite challenging. Thank you still. I would have never been able to figure this out on my own or get this far without the help from the community. 1.png

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    aenever's Avatar
    Join Date
    Jun 2013
    Posts
    1,409
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    Hi GaoLi,

    Sorry that the example didn't work so well, I must have played with it and forgot to do a last test. It turns out if you get rid of it all together it works seamlessly. Couldn't understand why it was needed in the first place?

    Prototype4.mfa

Similar Threads

  1. Character Jumping - Need Help
    By LuZ in forum Fusion 2.5
    Replies: 9
    Last Post: 19th June 2017, 11:30 AM
  2. Jumping off Enemy problem
    By SuperGamer in forum Fusion 2.5
    Replies: 10
    Last Post: 29th June 2015, 09:10 PM
  3. Need help with platformer (jumping)
    By Mystemo in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 8th May 2013, 01:15 PM
  4. Enemy movement jumping problem
    By Fralex in forum File Archive
    Replies: 2
    Last Post: 13th July 2011, 02:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •