How do I Grab & Throw System in Beat 'em Up Game?

0 favourites
  • 15 posts
From the Asset Store
10 Loopable Tracks, 4 Musical Stems, 5 Event Stingers, and 43 Sound Effects.
  • Hey guys,

    I'm looking a flexible solution to make grab & throw enemies in beat em up game, my idea to use Pin object and disable enemy AI when it's grabbed, but the problem is I don't know how to make grab properly due to secondary conditions, I need to make throw to right or left according to arrow keys like:

    <- + Button: Throw enemy to left

    - + Button: Throw enemy to right

    Attack while grab would be helpful, I attached a .capx here including animations and some basic setup, well I deleted all my grab implementations in event because this logic is broken and worthless, I'm tired of doing it during like 17 hours to figure it out and couldn't find a solution.

    Could you help me?

    Thanks!

    EDIT: Reuploaded Capx

  • Is complicated?

    If you find it's too complicated but want to help, I would like to paypal you if you resolve this. PM me for further details.

    Thanks!

  • Bump, anyone?

    EDIT: I noticed this attachment comes .capx error.

    I reuploaded a fixed version, my apologies.

  • Your posted capx is broken (The layout files are missing). I grabbed the art though and made an example of grabbing and throwing.

    https://dl.dropboxusercontent.com/u/542 ... throw.capx

    Space is used to grab and once an enemy is grabbed Space+Left or right will throw.

    After adding the sine behavior to the enemies I'm amazed by how enjoyable it is to throw the enemies off the screen.

  • R0J0hound Nice! I'm very sorry for .capx error.

    I never thought I would use "nearest pick" I'm almost satisfied but I couldn't figure out how to maintain the stand of enemy (Position Y) without throwing the enemies off the screen because it's japanese style beat 'em up game. More like a leap.

    I overhauled .capx with your method, there are 2 questions.

    1- What's good method to cancel grabbing when the other enemy attacked you?

    2- About throwing enemies without off the screen, Is supposed to use timer to disable bullet behavior and being thrown?

    If you have a chance to check it.

    Thanks!

  • Something you could try is having an invisible Bar across the window. Keep the bar at the "ground level" by using an image point on you players shadow. Then you could have a variable that triggers when a throw happens.

    "Compare Throw = true"

    "On collision with bar"

    Then you just change the sine wave information to make him bounce when he hits the bar.

    Alternatively you could just set a Y coordinate that's "Player.Y + number" then do

    Compare Throw = True"

    "Compare Badyguy.Y = Player.Y + (number)"

    I haven't played with Sin waves a lot so you'll have to mess around with the settings to get figure out how to make it bounce, but that's how you'd keep them from falling off.

    And if all of that is to complicated then you could give the enemies Physics(instead of bullets or Sine) and toggle it on/off for throws and use the bar as a solid object. Then for throw you use "Force at angle" instead of move at angle , and the bounce happens on its own when it hits the solid bar.

  • R0J0hound thanks I like it

  • WPGamer

    Would you check my .capx? it uses 8 dir behavior, I don't see a good reason to use "Bar" because it's for pure side-scroller.

    However,

    Compare Throw = True"

    "Compare Badyguy.Y = Player.Y + (number)" may be good idea

  • I'll add it to your project when I get back home, but basically you need to make a "Floor" collision box for each badguy. Then during a throw set the Y of the box to where you want his "floor" to be, and have the box following his X as you throw. 'Impulse at angle' throw him, then when he lands the physics will take care of the bounce for you.

  • Ok, added some comments to pave the way. The only issue I've ran into is that for some reason if two badguys are overlapping the first throw works, but the second doesn't if you do it right after. However, if you throw one, go to a different one, throw him, and go back to the one overlapping it works.

    This may just need some tweeks to fix.

    Well...idk where it saved it...haha hold on

  • Damnit...Apperently I deleted it some how haha. I'll be back in 10

  • OOookkkkk Here we go

    [attachment=0:rlg2cv6g][/attachment:rlg2cv6g]

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • WPGamer Hello, well I'm sorry but your .capx threw me an error, would you check your .capx?

  • [attachment=0:2mblna14][/attachment:2mblna14]

    I've been having the worst problems with saving stuff on C2 lately. Here's one that should work. I couldn't get yours to re-save so I just built a small demo so you get the concept.

  • WPGamer Look you don't need to use Physic behavior and extra sprite for ground collision, but I already understand your concept as well, sometimes using extra entity to make it work it's considered as bad practice but it's neccesary to understand the concept.

    Anyway, thanks a lot!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)