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

Get help using Construct 2

Post » Fri May 23, 2014 9:10 pm

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
You do not have the required permissions to view the files attached to this post.
Last edited by Joannesalfa on Mon May 26, 2014 6:19 am, edited 1 time in total.
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

Post » Sun May 25, 2014 12:37 am

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!
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

Post » Mon May 26, 2014 5:18 am

Bump, anyone?


EDIT: I noticed this attachment comes .capx error.

I reuploaded a fixed version, my apologies.
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

Post » Mon May 26, 2014 6:33 am

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.
B
92
S
32
G
109
Posts: 5,290
Reputation: 70,991

Post » Mon May 26, 2014 7:12 am

@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!
You do not have the required permissions to view the files attached to this post.
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

Post » Mon May 26, 2014 8:26 pm

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.
B
13
S
3
G
2
Posts: 45
Reputation: 2,308

Post » Tue May 27, 2014 11:05 am

R0J0hound thanks I like it
B
252
S
39
G
15
Posts: 1,964
Reputation: 40,748

Post » Wed May 28, 2014 8:30 pm

@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
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

Post » Wed May 28, 2014 10:45 pm

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.
B
13
S
3
G
2
Posts: 45
Reputation: 2,308

Post » Thu May 29, 2014 3:03 am

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
B
13
S
3
G
2
Posts: 45
Reputation: 2,308

Next

Return to How do I....?

Who is online

Users browsing this forum: KTML5 and 26 guests