Game Development Community

T2D Pong

by Harold "LabRat" Brown · in Torque Game Builder · 02/25/2005 (10:49 pm) · 11 replies

Download Updated at 12:30 am on February 26, 2005

torque.feylab.com/downloads/T2DPong.zip

Extract the pong.bat and Pong.zip file... place them in the same folder as your t2d.exe file (should be c:\torque 2d\SDK\example\ for default install) .

execute the .bat file

Controls:

Player 1
-----------
W - Move up
S - Move down

Player 2
-----------
O - Move up
L - Move down

Both
--------
space - Serve Pong

NOTES:

You do not need to extract the Pong.zip file
This does not include the script files at the moment

UPDATES:
12:30am 2/26/2005 - Increased the speed of the paddles and added computer control for the Player 2 paddle.

#1
02/26/2005 (4:44 am)
Great stuff Labrat!

No only does it look authentic it shows a "clean" way to distribute T2D stuff.
#2
02/26/2005 (5:55 am)
Awesome Labby. You rock man. Woo!! First community T2D game!!
#3
02/26/2005 (10:44 am)
Just to mention this, I'm doing a commercial (indie) 2-player pong game with characters, environments, powerups, so I'm definitely gonna look at this to learn faster. All our art and sound is 95% finished, so this game will be out the gate pretty quickly.

Thanks for the great tools! It'll be wonderful to focus on gameplay rather than low-level tomfoolery. :)
#4
02/27/2005 (5:45 am)
Awesome Jason.

So many games seem to be on the way and it's only day#2..... my god, what have we unleashed!!!!!!

The world will never be the same. :)

- Melv.
#5
03/09/2005 (3:12 pm)
Harolds version of pong inspired me to implement Pong as my first Torque 2D game. Took less than a day to create, with a little extra time spent today tidying the code up and messing around with alternative ways to acheive the same thing :P I've reused Harold's scoreboard font, hope you don't mind.

www.figmentgames.com/pong.html

BTW I removed all the gui's, cs files and the two editors, leaving just the dso's. However, no matter what I do, the main.cs file that lives in the same dir as the T2D.exe never produces a dso. Is there any way I can force it to compile so that I don't have to distribute any cs scripts at all? Its the only cs file in the distro, but I'd rather not have any if possible.
#6
03/09/2005 (4:47 pm)
Getting rid of that single main.cs file would require changeing the C++ source code.
#7
03/10/2005 (1:20 am)
@Gary: As LabRat mentioned, this is the only ".cs" file called by the engine. It is called after all the internals have been setup and starts the ball rolling. You should be able get the system to compile a root file then execute it pretty easily.

You can find it in "\engine\game\main.cc" (approx line 266)...
bool runEntryScript (int argc, const char **argv) 
{
    ....
    const char*  defaultScriptName = "main.cs";
    ....
}

- Melv.
#8
08/06/2005 (11:32 am)
Hi guys.

Sorry to ressurect an old thread, but is there any chance anyone could post their "Ponglike" bat and ball collision code for me to look over?
I am trying to make a pong like game to learn about the engine but have got a bit stuck in this area.

My 2 main problems are :

1) The ball sometimes hits the paddle and sort of slides directly up (or down) the screen, resulting in a "deadball" situation.
2) changing the angle of deflection based on where the ball hits the bat.

Thanks in advance.


Mike
#9
10/13/2012 (8:12 pm)
Is their an updated file for this? I cant get this file to work in the current version of torque 2D that I have?
#10
10/13/2012 (11:06 pm)
Do you have any specific problems it's giving you or does it just not say or do anything?
#11
10/25/2012 (12:14 pm)
@Paul Between when this thread was started and now has been 7 years.