# Thread: Old console tennis game, what is the mechanism behind it?

1. ## Old console tennis game, what is the mechanism behind it?

Hi all,

Before using CF, im using AGK2 with initial intent to make a 2d tennis games but fail to dig out on how the mechanism of fake depth work and also its collision. So in AGK2, i am making 3d badminton game with 3d and pixel art texture. But now im have a wonderful 2d gamemaking tool(that is CF), i really want to learn how classic 2d tennis are made.

And so far, all i can assume is the fake depth can be simulate by using the slower Y coord. How about the skewed court?Is it still square grid?How about collision then? Refer pic attached from Sega Wimbledon.

Can someone give me ideas on hows thing working?

Thanks

2. Not sure what way you are going about doing this and how far you've got but, off the top of my head, I'd model the tennis game in an array and then just draw the graphical representation of the array separately. I'd need to think a little bit to give you the maths for how to draw it but it shouldn't be too taxing.

Edit:
Scrap that; that's stupid. Working through an entire array every frame just to find a single tennis ball is very inefficient. I'd have a tennis ball object with properties about it's position in 3-dimensional space and various other properties related to it's speed, direction, spin, etc. (depending on how complex you want to make it) and draw it every frame.

3. You could actually keep the collision simple and make a rectangular area (off screen) where you move your players, bounce your ball and do collision checks. Then use the positions of your ball and players and “translate” them into skewed screen coordinates. This is what you see in the end.

4. Is this the sort of pseudo-3D mechanics you're after?

5. Originally Posted by mobichan
You could actually keep the collision simple and make a rectangular area (off screen) where you move your players, bounce your ball and do collision checks. Then use the positions of your ball and players and “translate” them into skewed screen coordinates. This is what you see in the end.
Wow Thanks! Thats sound hard but shed some light. What u mean is a make an offscreen player and ball(say top down view)...and what the user see is just a translation in fake 3d world?

6. Yes. That is what I am saying exactly. . Sort of like how most Mario Kart examples work. You have a sort of “ mini map” view where the actual game takes place. This is not shown to the player. Then translate the values into a skewed 3D view the player sees. I probably won’t have time to make an example for a day or two, but maybe someone else can code up an example sooner?

Another alternative would be to skew the screen with a shader or try the Mode7 object. But depending on which runtimes you want to support you might want to do this without fancy extensions.

7. Originally Posted by Graeme2408
Is this the sort of pseudo-3D mechanics you're after?
Yes, it look like that but tricky part is volley movement Thanks

8. Originally Posted by aenever
I give it a look Thanks

9. Originally Posted by hoyoyo80
Yes, it look like that but tricky part is volley movement Thanks
Use a variable to set the height of the ball. So a setting of 0 would be ground level, then say max height would be 10. Use the height to scale the size of the ball (gets bigger as it goes higher). Use an active to create a shadow - always set the ball to the position of it's shadow while height is 0. As height increases, off-set the ball vertically by a similar scale), e.g. for every increase in height by 1, off-set the y value of the ball by 5 pixels.
Depending on how you want your tennis game to play, to keep it simple you could have it so the ball always returns to height=0 by the time it reaches a player. Making so you can hit a ball on the volley is bit harder but could be done fairly easily by comparing the ball's height value to a height value assigned to the player's racket.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•