Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / Pongis - Pong meets Tennis

Author
Message
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 14th May 2007 18:51
I could have sworn I'd posted about this already, but seems I haven't (according to My Threads).

www.thingy-ma-jig.co.uk/projects/pongis

Its sort of like pong, except your paddles move around a center point and the ball has gravity, so you end up playing an every increasingly frantic game resembling table tennis.



The controls are Shift/Ctrl on the left and right of the keyboard for player 1 and 2 respectively.

Thoughts? As this game is so damn simple, I'd like to get some nice retro graphics in there. I'm considering using Cloggy's 3D plugin and to draw some "exploding" lines coming out of the paddle, floor and ceiling upon collision hit.

I'd also REALLY like to get spin on the ball too - but I'd like it to be realistic (eg, effect the ball flight properly too).

[center]
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 14th May 2007 18:55
I don't see a download link.

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 14th May 2007 19:09
Its in between the Files bar and the Adsense... I need to theme that bit of the site better! Thanks for pointing that out.

[center]
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 14th May 2007 19:15
Exactly how far in between?

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)

Attachments

Login to view attachments
Julius Caesar
18
Years of Service
User Offline
Joined: 14th Apr 2006
Location:
Posted: 14th May 2007 19:31
I don't see the link either, but the screenshot looks like it could be a cool game. I like the way you can angle your bat, I'll bet you can get some cool shots like that! One question, can you do "Power Shots"? Because that is a reallt big part of table tennis!

I hate to ask silly questions, but I have one thats never been answered. "What is the formula for bouncing?" I mean, what do you do to the movement angle, to acheive a bounce effect?

SO, here is me seeing you game and being amazed that another person has done bouncing, something that I have devoted so much time to attepmt to figure out!

Thanks!


Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 15th May 2007 01:48
Benjamin - thanks for pointing that out. I only ever really visit my own website while logged in, so I see everything. It seems I forgot to give anonymous people permission to download files THAT could explain why I have no comments on them lol!

@Julius - thanks. Powershots aren't in yet - but sound like an interesting idea, equally - if powershots go in, then there needs to be an "absorb" shot which slows it back down maybe?

The formula involves vectors... This is my collision function:


Now, basically... It does this:
1) if hit is true - run the function. I must have coded this tired... That's just bloody stupid...

2) Get the normal of the paddle. As I recall (might be wrong) sin/cos produced a parallel vector whereas cos/sin produced a normal. A normal is a vector which is at 90 degree's/perpendicular to its surface.

3) I have the speed of the ball stored in vector 1, I then take the unit or "normalized" version of it and put it in vector 3. The unit vector is basically the same vector in direction, but its length is 1.0 (so its scaled up or down)

4) Invert the speed unit vector - this basically provides momentum in the opposite direction.

5) Dot Product the normal of the paddle and the inverse unit speed of the ball. Dot Product is where it gets a bit voodoo... Suggest you wikipedia/google it or lookup a Vector Tutorial on these forums - I think it was done by Philip... The Dot Product seems to return a float...

6) On a copy of the normal of the paddle, multiply it by the dot product.

7) Inverse out speed unit vector back again

8) Add the speed unit vector to the vector produced by step 6

9) Normalize it (length to 1.0)

10) The ball speed is now the length the original ball speed vector (1) multiplied by 1.05. This causes the ball speed to increase by 5% on each paddle hit.

11) Cap the ball speed at 30 (world units per section...)

12) Set the ball speed vector to the unit vector calculated in step 9 multiplied by the new speed calculated in step 10.

Please dont take this as gospel - I've found a method which seems to "work"

[center]
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 15th May 2007 01:57
It's an interesting concept, the curved movement of the paddles makes it a bit hard though. What I'd really like to see is something like this, but where you can move the paddle with the mouse, and have a proper net in the middle. And multiplayer. Hint hint.

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 15th May 2007 02:03
lol - well I've kind of got the hang of MultiSync now with my BoxWars game (COMING SOON)... However I've kind of stretched myself a little... Game wise I have This, Box Wars and a few others on a burner... Plus I have my own website... Plus I'm helping a friend out launch his website... Plus i'm working with a friend on a project together using Ogre and C++ (all new to me)... Plus I'm a mentor for a Google Summer of Code project...

DAMN - who's idea was it to put 24 hours in 1 day?

[center]
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 15th May 2007 15:51
My keyboard only has the right shift so player one usually won .

Login to post a reply

Server time is: 2024-09-29 20:36:19
Your offset time is: 2024-09-29 20:36:19