How do I Predict Volleyball bumps

0 favourites
  • 7 posts
From the Asset Store
Let's see how long you can keep up the ball without letting it fall on the ground!
  • I was thinking of making a wacky Volleyball game of some nature. I was fooling around with physics and then the bullet behavior and didn't think they were the right solution for what I would like. I believe I need more control over where the ball bounces for bump passing to your team mate.

    Could I get some help to send me in the right direction on what math I need to implement for something as described in my image attachment? I would like to understand how a to get the ball to arc towards a destination and have the weight of a volleyball.

  • This might help.

  • Thank you for the link randomly but r0j0hounds links are dead. I saw that article but unfortunately the capx's files are toast.

  • I'm not sure that link would help.

    You can do the projectile motion by giving the ball two variables: vx and vy

    Then the motion is done with one event:

    Global number g=100

    Every tick

    --- ball: add g*dt to vy

    --- ball: set y to self.y+self.vy*dt

    --- ball: set X to self.x+self.vx*dt

    g is the gravity value. Next you can do bouncing with:

    Ball overlaps head

    Ball: vy>0

    --- Ball: set vy to -self.vy

    --- ball: set vx to g*(otherhead.x-self.x)/(-2*self.vy)

    So that will make the ball bounce back up to basically it's original height and vx is set so the ball will land on some other head.

    That formula can be found by using these two projectile motion equations:

    Y=y0+vy*t+0.5*g*t^2

    X=x0+vx*t

    Just solve for vx with the simplification of y=y0. Solve it without the simplification if you want the ball to land on different heights.

    On a final note, you can make the height the ball bounces back to by changing the "set y" action to:

    Ball: set y to self.y+self.vy*dt+0.5*g*dt*dt

    And moving the set vy action below it.

  • Part of the beauty of physics is it responds naturally to collisions which has some unpredictability in real life.

    In most voleyball games I have played the physics are actually over rode and when you locate your player under the ball you use some other form of control like crosshairs to bump the ball towards another player or position.

    I would use something like the trajectory control in angry birds or a cross hair with X and Y vector so the player can see where the ball will be bumped to on the field or to a player.

  • R0J0hound thank you for spending the time to write such a thorough explanation. You have consistently been a great help over all the years.

    lamar thanks for the great suggestions.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)