User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: How can I make an enemy that pushes away the player?

  1. #1
    Clicker Fusion 2.5

    Join Date
    Oct 2012
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How can I make an enemy that pushes away the player?

    What I mean is, when the player gets close close to an enemy, the player is bounced away from the enemy. Is there anyway to do this? I already created the detectors and the AI for the enemy. I just need to use the detectors too.

  2. #2
    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)
    Is this a platformer?
    What do you mean by 'Bounce Away'?

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    jn2002dk's Avatar
    Join Date
    Mar 2014
    Posts
    217
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I guess it depends on what type of movement you're using for your character

    You might be able to do it by adding a physics movement to your player as a 2nd movement. Then, once you want to bounce the player, you would switch to the physics movement and add impulse. Once the character is on solid ground again, switch back to the original movement

  4. #4
    No Products Registered

    Join Date
    Sep 2015
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey maybe this might point you in the right direction...
    https://www.youtube.com/watch?v=rqC2d_W_dHA

  5. #5
    Clicker Fusion 2.5

    Join Date
    Oct 2012
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by King_Cool View Post
    Is this a platformer?
    What do you mean by 'Bounce Away'?
    What I mean, is that the enemy literally causes knock back when the player walks into it, like physics similar to a ball. I`m using PMO object for the player's movement.

  6. #6
    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)
    Just a horizontal knock back?
    Or a a "jump" backwards?

    In either case, using pmo, you could have Player enter a 'Knockback' state in some way ( setting a Countrr or animation or what have you ).

    When in Knockback state, you can disable player controlls snd use the PMO to change speed/ veloity/ gravity or even trigger a jump of the Player.
    As the Knockback state ends, reenable the controls and make sure to reset gravity etc.

    Sorry, I'm on mobile

  7. #7
    Clicker Fusion 2.5

    Join Date
    Oct 2012
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just horizontal knock back.

  8. #8
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    PixelABCD's Avatar
    Join Date
    Apr 2014
    Posts
    237
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    you have to deactivate movement functions first, disable inputs by any condition or deactivate (input might as well work only if set knock back string is OFF) .

    To set Knockback event:
    set knocback time value to any number you desire (20-200 for test), string knockback ON. Set velocity X to 0 (this should stop X movement). Then you can set(or add) X velocity to - (left knockabck) or + (right knoback). You might also wish to limit or increase Max. x Velocity for knockback, after knoback you should reset max. velocity it back to its value. I plan to create something like this - I didnt have time yet.

    you could add some timer value if knockback is ON (lets call it knockback time), which runs under condition

    ;if knockback time > 0,
    sub 1 (or any number) from knockback time

    ;if knoback time <= 0
    set knockback OFF (this can also reset PMO's value as you need and resume your other movements)


    this is my idea how horizontal knoback might work. I have to try it first before jumping into any conclusion. If this isnt working with X velo, you might try to use additional X velocity here (I didnt try it yet.).

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    jn2002dk's Avatar
    Join Date
    Mar 2014
    Posts
    217
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quick and dirty example using only the PMO

    Please ignore the Clickteam Movement Controller object if i forgot to remove it

    BouncePlayer.mfa

  10. #10
    Clicker Fusion 2.5

    Join Date
    Oct 2012
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. How to make an enemy shoot directly at the player?
    By LemonyLime in forum The Games Factory 2 - Technical Support
    Replies: 18
    Last Post: 8th January 2017, 10:23 PM
  2. Enemy Follows Player Example
    By Ryan in forum File Archive
    Replies: 5
    Last Post: 25th February 2010, 02:20 PM
  3. Enemy/Player AI
    By artician in forum The Games Factory 2 - Technical Support
    Replies: 2
    Last Post: 17th May 2008, 03:26 AM
  4. Enemy is following the player
    By Rabagast in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 6th April 2008, 07:26 AM
  5. Moving an enemy towards the player
    By Jason in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 11th January 2008, 01:22 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
  •