Ball height on a 2d soccer game

Started by
1 comment, last by arthursouza 10 years, 9 months ago

Hey guys! Im working on making a quick soccer game, just for fun, started on it last night, and it kinda looks like this:

http://www.gamedev.net/blog/1480/entry-2256581-working-on-it-brazuca/

Is just some mouse action, the gameplay is basically kicking the ball.

Now, I'm wondering about what can I do to simulate the ball height. I have to be able to kick the ball high or low, to kick above other players, and high on the goal, and I also have to be able to kick too high and miss the goal.

I'm thinking about adding a height variable to the ball, and having the ball sprite showing the ball higher or lower, and having the position variable on the ball reflecting the actual GROUND position on the ball, so that, to check where the ball is, i check both the position and the height, which gives me 3d coordinates.

I'm not sure about how good would this solution be, and maybe someone that has worked with projectiles and that kind of stuff in 2d games can give me a hand.

Advertisement
Having a coordinate for the height is straight forward enough. You may want to display a shadow for the ball or something like that (maybe just a mark on the ground where the projection of the ball is) as a hint to the player as to how high the ball is.

Yep, thats suresim a thing, I guess this approach in general would be simple enough...

This topic is closed to new replies.

Advertisement