• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

A ball with a dynamic 2.5D shadow HELP!

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!
 

sp202

Member
I'm confused, first as to why you're using two separate objects when you can draw the shadow within the ball object, and secondly as to why you're applying physics to the shadow (which will be at ground level at all times) and not to the ball.
 
Top