Assistance required - shield bounce

0 favourites
  • 6 posts
From the Asset Store
Bouncing ball
$4 USD
60% off
Template for a bouncing ball game, fully documented in comments and video
  • 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:

    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.

    Any thoughts? I can post the capx file (where is a good place to host it?)

  • 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.

  • 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

  • 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

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

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