V
VeSo
Guest
Hey guys it's been a while- I'm making a cricket game a lot like this:
It's a perspective-based 2.5D game and requires the ball to be hit in the air and along the ground.
I'm really struggling to get this off the ground (literally) because I need the ball to offset the shadow according to a "bounce" variable that I've declared globally.
This is what I'm trying to achieve:
-Two objects obj_ball and obj_shadow
-obj_shadow is the ACTUAL ball that will be interacted with by the players and the physics.
-obj_ball is merely the object that hangs off the obj_shadow to make the player think the ball is a certain height
-obj_target is the x,y, spot on the pitch where the ball is headed for upon release.
> The bowler runs in, releases the obj_shadow
> the bounce variable is set to 250 (the height of the ball at release)
> the obj_ball object then must hang off of the obj_shadow in a STEADY offset on its way to the target object.
This means, the balls image must fall to the shadow in a perfect gradient from the height (250) to the target.
This can be calculated like:
Distance to object target (which is about 1266px) divided by the bounce height (250) = 5.04.
We have a number for the gradient, but we need to apply that number over the distance equally to give the impression that the ball is indeed on its way down!
Any help appreciated!
It's a perspective-based 2.5D game and requires the ball to be hit in the air and along the ground.
I'm really struggling to get this off the ground (literally) because I need the ball to offset the shadow according to a "bounce" variable that I've declared globally.
This is what I'm trying to achieve:
-Two objects obj_ball and obj_shadow
-obj_shadow is the ACTUAL ball that will be interacted with by the players and the physics.
-obj_ball is merely the object that hangs off the obj_shadow to make the player think the ball is a certain height
-obj_target is the x,y, spot on the pitch where the ball is headed for upon release.
> The bowler runs in, releases the obj_shadow
> the bounce variable is set to 250 (the height of the ball at release)
> the obj_ball object then must hang off of the obj_shadow in a STEADY offset on its way to the target object.
This means, the balls image must fall to the shadow in a perfect gradient from the height (250) to the target.
This can be calculated like:
Distance to object target (which is about 1266px) divided by the bounce height (250) = 5.04.
We have a number for the gradient, but we need to apply that number over the distance equally to give the impression that the ball is indeed on its way down!
Any help appreciated!