Assistance required - shield bounce

Get help using Construct 2

Post » Fri Jan 01, 2016 3:17 am

Hello,

I am creating a side scrolling platform with knight who uses a sword and sheild.

However the issue I am having is when the robot bounces off the shield, sometimes they bounce through it and damage the player.

See below:
Image

It's completely random.

The robots have bullet behavior. On collision with the shield they bounce off an invisible rectangle that is as tall as the knight, but in line with the shield. When i tired bouncing right off the shield they went in random directions as sometimes their legs would hit the shield.

Image

Any thoughts? I can post the capx file (where is a good place to host it?)
Last edited by lorddragonmaster on Fri Jan 01, 2016 5:44 pm, edited 1 time in total.
B
5
S
1
Posts: 10
Reputation: 393

Post » Fri Jan 01, 2016 4:22 am

Have you tried changing the hitbox for the enemies so that their legs arent taken into consideration? Just set it up for their torso, that might help.

As for free hosting space, I use https://www.sendspace.com/, no registration, no logins no hassle.
Brick by brick, stone by stone.
B
56
S
25
G
18
Posts: 273
Reputation: 13,363

Post » Fri Jan 01, 2016 5:47 am

Solomon wrote:Have you tried changing the hitbox for the enemies so that their legs arent taken into consideration? Just set it up for their torso, that might help.

As for free hosting space, I use , no registration, no logins no hassle.


I only created a separate hitbox for the player.

However I did just test it (creating a hitbox for the robot to collide with the player), and the issue of the robot bouncing through the player still happens. I'm not sure if it is due to the bullet behavior that I am using for my bounce.

Here is the file if anyone wants to take a look. (this version has no hitboxes for the robots)

sendspace.com/file/500vzh
Last edited by lorddragonmaster on Fri Jan 01, 2016 7:06 pm, edited 1 time in total.
B
5
S
1
Posts: 10
Reputation: 393

Post » Fri Jan 01, 2016 7:18 pm

I didn't download the .capx, but the GIF shows them only getting through when you're facing the left. Does it only happen when you're facing the left? Or does it happen in both directions?


--

Also, I'm suspicious of that Wait 0.3 Seconds to set Defend to False. Let me download the capx
B
8
S
1
Posts: 39
Reputation: 536

Post » Fri Jan 01, 2016 7:52 pm

talqvist wrote:I didn't download the .capx, but the GIF shows them only getting through when you're facing the left. Does it only happen when you're facing the left? Or does it happen in both directions?


--

Also, I'm suspicious of that Wait 0.3 Seconds to set Defend to False. Let me download the capx


Happens randomly from either direction. Also that wait 0.3 seconds is to allow the robots to bounce and act as bullets. If i leave it at 0 then they wont move.

The idea is the moment they hit the shield they turn into bullets and bounce for the distance they can get to in 0.3 seconds, and then turn their bullet behavior off.
B
5
S
1
Posts: 10
Reputation: 393

Post » Sat Jan 02, 2016 6:24 pm

I don't yet have a solution. I did look around, though, here are some things I saw. Let me know if they are not things to worry about or if they may be clues?

Check the animation frames of the Knight. Half of them are tightly drawn around the sprite, the other half are the entire sprite box. This COULD lead to your issue, but I don't think this is it, since you are both using the Defend animation during defending (obviously) and also it looks like you're using PlayerBox to check collisions anyway.

One thing I want to do is make the red PlayerBox visible so we can see if it's behaving properly the whole time.
^^Okay, I did that. That seems to be working fine. Although I'm not sure if it's changing it's size suddenly in between a frame so we can't see it.

I'm sort of typing as I check things out in case others want to jump in on this.

Now I'm suspicious that the Droidwalkers are the main culprit. I couldn't figure it out, but the (Robot overlapping Playerbox) hit is being triggered BEFORE the (On shield collision with robot) event even begins. Possibly one frame before. I know this because I gave the Robots an instance variable called "BeingBounced", and on Shield collision I set BeingBounced to "Yes", and after the 0.3 seconds, back to "No"
Then I set the Robot overlapping playerbox conditions to INCLUDE BeingBounced = "Yes" and it STILL happens. So it's safe to say that it's Overlapping the playerbox before it even registers a collision with the shield.


Sorry I couldn't figure it out. Hopefully I gave some clues.
B
8
S
1
Posts: 39
Reputation: 536


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 7 guests