User Tag List

Results 1 to 8 of 8

Thread: Knockback

  1. #1
    No Products Registered

    Join Date
    Aug 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Knockback

    Is there a way to make a character go backwards when hit? I cant figure out a way to program this.

  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: Knockback

    It depends largely on the engine that you've already got programmed.

    You would need to store the number of pixels to knock back (horizontally) in an alterable value, check this and move the player on every cycle of the event list, and reduce the value gradually to zero. The same would go for the vertical axis.

  3. #3
    No Products Registered

    Join Date
    Aug 2006
    Location
    Spryfield, Nova Scotia, Canada
    Posts
    85
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Recoil?

    Sometimes the recoil is not a good idea. Like I remember when I used to play CastleVania on my old NES, it used to get really irritating in the second stage when those pushy Medusa Heads would butt you into a pit every single time. They were difficult to effectively attack and often seemed too agile to maneuver around. I rather like a hit effect such as might be seen in the NES classic, Punch Out!!, where it might show his eyeballs bulge out, etc.

  4. #4
    No Products Registered

    Join Date
    Aug 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Knockback

    []It depends largely on the engine that you've already got programmed.

    You would need to store the number of pixels to knock back (horizontally) in an alterable value, check this and move the player on every cycle of the event list, and reduce the value gradually to zero. The same would go for the vertical axis. [/]

    Could you be a bit more specific on how to do this? Im still confused.

  5. #5
    No Products Registered

    Join Date
    Jun 2006
    Location
    Land of raging rockets
    Posts
    1,231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Knockback

    Use an alterable value of your player character. Let's say you rename alterable value A to "knockback".

    Add events:

    * "knockback" > 0
    then subtract 1 from "knockback"
    then set x position of player to x position of player -1

    * "knockback" < 0
    then add 1 to "knockback"
    then set x position of player to x position of player +1

    * enemy hits player
    then add to "knockback": x enemy - x player

    <or alternatively>

    * enemy hits player
    then add to "knockback": (Abs(x enemy - x player) / (x enemy - x player)) * 5

    (will knock player back 5 pixels)

  6. #6
    No Products Registered

    Join Date
    Aug 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Knockback

    I put this in, but it said there was a syntax error. Are you sure it works?

  7. #7
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    682
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Knockback

    []I put this in, but it said there was a syntax error. Are you sure it works? [/]
    you can't just copy-paste what random sugested, if you did do that... You have to do all the value setting and positional stuff 'manually'... or maybe you just left a bracket out in your expression...

  8. #8
    No Products Registered

    Join Date
    May 2007
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Knockback

    if you devide object one x value by object 1 x value, you'll always get one. try doing this without the second devider. (I use TGF1. can anybody help me with the "game logic" for a flying back motion? I'm rather curious on this subject myself.)

Similar Threads

  1. Knockback Help?
    By inspiredsimji in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 12th June 2013, 06:49 PM
  2. Knockback
    By Top_of_the_Temple in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 3rd May 2013, 01:26 PM
  3. Can I Put Knockback??
    By Talario in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 19th April 2010, 02:12 PM
  4. PMO player knockback
    By Atherton in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 26th August 2009, 06:48 PM
  5. Knockback effect?
    By Senx in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 18th July 2008, 05:53 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
  •