0
\$\begingroup\$

This question already has an answer here:

I want to create a sports simulation game, something along the lines of Championship Manager (if you're not familiar, you can check out https://www.youtube.com/watch?v=t2FlFWP3K28). It's essentially a 2D game with top-down view, with the exception that the ball seems to behave as if it was 3D.

Given that the game is almost entirely 2D and only the ball is 3D, is there a good way to deal with that without making an entirely 3D game just because of the ball? Can the ball be hooked into a 3D physics engine, the rest to a 2D engine and somehow reconcile the two, then when rendering, just make the ball grow the higher it goes and show a shadow, or something along those lines?

\$\endgroup\$

marked as duplicate by jgallant, Alexandre Vaillancourt, Anko, Community May 16 '16 at 23:57

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • \$\begingroup\$ "My question is [...]" Yes. No rendering on the server needed. For the rest, your question is too broad/off-topic. Please limit your question posts to a single, very specific question. \$\endgroup\$ – Alexandre Vaillancourt May 8 '16 at 13:09
  • \$\begingroup\$ Yeah, you're right. The server part of my question is all over the place. I'll actually remove that and think of a narrower scope. Meanwhile, the 2D/3D part was pretty specific, so I'll just keep that part of it. Does that work? \$\endgroup\$ – Rocket04 May 8 '16 at 16:01
  • \$\begingroup\$ We have a similar question on faking 3D flight of a 2D arrow. Substitute the arrow for a ball and it's the same question, right? \$\endgroup\$ – Anko May 15 '16 at 23:57
1
\$\begingroup\$

You can achieve the effect of the ball by modifying two things: 1. The game object's size. Whenever the ball is kicked modify it to match the specific action, like a long lobbed pass will make the ball bigger. 2. The texture that is being applied to. Make the texture repeat itself on the direction it is going. For example a forward pass will make the texture move forward (repeated tiling) and a swerve will move it on the x and y axis at the same time, making the ball look like it is spinning.

Combine both to achieve the desired effect. The shadow can be another spherical game object with varying alpha values (transparency).

\$\endgroup\$
0
\$\begingroup\$

I would just cheat and use the formula for a parabola. The ball sprite can be sized based on the height of the parabola.

\$\endgroup\$
0
\$\begingroup\$

The game is either doing some trickery to achieve a 3D like trajectory (sine waves, parabolas, etc) or using actual 3D math.

Then, they simply take the 3d coordinates, and render the ball larger or smaller depending on the depth. Essentially rasterizing.

Shadows are achieved either again with 3d math by projection or simply faking it again with a simple distance algorithm (shadow position.x = ball position.x - ball.position.z * some scale)

\$\endgroup\$
0
\$\begingroup\$

You can make the shadow by simply parenting a Sprite with a black circle and adjusting it to be below the ball so that when ball moves this Sprite moves and it looks like shadow. The 3D effect by changing scale depending on the depth or use triggers to shrink it on entry.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.