Before you try making a pong level, you should have a decent amount experience with jed- you should know how to add templates, place cogs, set frames for objects, and the like.
Download this first! (http://www.massassi.net/tutorials/pong/neededfiles.zip)
This contains all the files necessary to make a pong level: the COG files, the new templates, etc.
Note that even if you have the original "For Authors.zip" you should download this, because the cogs have been updated and are now much easier to work with.
A lobby- where players
will first spawn.
2 team entrances- 1 red,
1 gold. Best way I've found is doorway leading to a
vertical shaft, which is cleaved into 3 sectors
horizontally (so there are 3 sectors stacked on top of
2 control rooms- 1 red, 1 gold. These
must be split up in a certain way. In front of the
viewing window through which you watch the action, there
must be three sectors lined up in a row. There also must
be a button used for "serving" the ball, and a
cancel switch. It's best if each of these control rooms
has exactly 8 sectors- if they don't you'll have to do a
little bit of cog editing- don't worry, I'll lead you
through that later on.
An arena- at either end there must be a
sector which will be designated as the goal.
4 scoring surfaces- 2 red, 2 gold.
Once you have your level built the way you want it, you should start adding the items. Here is how you'll need the items set up.
24 walkplayer things-
the first 8 will be the locations the red player will
respawn if he dies, which should go in the red control
center. The next 8 will be where the gold player
respawns- these should be placed in the gold control
center. The final 8 will be where the players who are in
the lobby respawn. They should, of course, be placed in
2 paddles- 1 for the red
player, 1 for the gold. Each of these paddles should have
2 frames- the 1st at the furthest position to the left
that the paddle will reach, to 2nd to the furthest
position on the right of the paddle.
4 ghosts- 2 for the
places the ball starts, 2 to make sure the player can
safely enter the level. The first ghosts should be placed
at the locations that you want the pong balls to appear
when the players serve- 1 for gold, 1 for red. Make sure
you have them pointed in the direction you want the ball
to go as well. The second 2 ghosts should be placed at
the tops of the entrance shafts.
Now that you have all the sectors, surfaces and things set up correctly, it's time to start assigning these values in the actual pong game.
For this part, you need to get the Pong cogs. These are available in the zip at the top of the tutorial- they've been cleaned up a bit from the ones in the original release, so they're easier to set up. Stick those cogs into your project directory and then, using the "Placed cogs" window in JED (F7) place those cogs into the level. Now, select the first cog, pong_main.cog, and let's start assigning those values.
1: Noteam_reset: These should be one of the last 8 walkplayers- the ones where the players without a team respawn.
2: Red_reset: One of the walkplayers for the red player
3: Gold_reset: One of the walkplayers for the gold player
4: Red_ball: The Thing where the pongball starts when red serves
5: Gold_ball: The Thing where the pongball starts when gold serves
6: Red_paddle: The red paddle
7: Gold_paddle: The gold paddle
8: Red_button: Red's serve button
9: Gold_button: Gold's serve button
10: Red_cancel: Red's cancel switch
11: Gold_cancel: Gold's cancel switch
12: Redscore, Redscore1: The surfaces that display Red's score
13: Goldscore, Goldscore1: The surfaces that display Gold's score
14: Red_center: The center sector of the 3 with which red moves his paddle
15: Red_left: The left sector of the 3 with which red moves his paddle
16: Red_right: The right sector of the 3 with which red moves his paddle
17: Gold_center: The center sector of the 3 with which gold moves his paddle
18: Gold_left: The left sector of the 3 with which gold moves his paddle
19: Gold_right: The right sector of the 3 with which gold moves his paddle
20: Red_enter: The sector in the red entrance shaft that sticks the player in the red control room
21: Gold_enter: The sector in the gold entrance shaft that sticks the player in the gold control room
22: Gold_score: The sector which gold has to hit the ball into to score on red- the sector is right in front of Red's control room.
23: Red_score: The sector which red has to hit the ball into to score on gold- the sector is right in front of Gold's control room.
Ok, that wasn't so hard, now was it? We're now ready to move on to Pong_Safeentry.cog. This one's a lot easier than the last.
1. Mark_red1: The sector at the VERY BOTTOM of red's entry shaft- below the Red_Enter sector you set in Pong_Main.
2. Mark_gold1: The sector at the VERY BOTTOM of gold's entry shaft- below the Gold_Enter sector you set in Pong_Main.
3. Ghost_red: The ghost you placed at the top of red's entrance shaft
4. Ghost_gold: The ghost you placed at the top of gold's entrance shaft
Ok, and now onto the last cog, Pong_Respawn. If
you have exactly 8 sectors inside each of your control rooms,
proceed with this section. If you have more or less than 8
sectors in the control rooms, go down to the next section,
entitled "THE HARD WAY".
1. Mark_red: The same sector as Red_enter in pong_main
2. Mark_gold: The same sector as Gold_enter in pong_main
3. Red1 - Red8: Each of the sectors which make up red's control room. The first sector is red1, second is red2, etc.
4. Gold1 - Gold8: Each of the sectors which make up gold's control room. The first sector is gold1, second is gold2, etc.
For all of you who chose to be more creative with
your levels, you'll have to do a little more work. Don't worry,
this won't be all that difficult. First determine how many
sectors there are in each of your control rooms. Now open up
pong_respawn.cog in notepad, and find the section that looks like
Now add to that list so there are the right number of sectors for the red control room. Let's say you have 13 sectors instead of 8- when you're done it should look like this:
Now find the section that looks like this:
And do the same, add the number of sectors so it's the same as in gold's control room. Once again we'll go with the number 13.
Now that you've done that, scroll down to the section that looks like this:
And change it so it has the right number of sectors for red and gold, and looks like this:
Then do the same for each of these:
So they look like this:
Now save it, go back to the placed cogs section and set Red1-Red13 and Gold1-Gold13 to the sectors which make up your control centers for red and gold.
Ok, set up your episode.jk and cogstrings.uni
like with any other level, then paste this into cogstrings.uni:
"COG_01001" 0 "Welcome
to Jedi Knight Pong! Programmed by LikWid"
"COG_01002" 0 "The Gold Player has won!"
"COG_01003" 0 "The Red Player has won!"
"COG_01004" 0 "The game is over."
"COG_01005" 0 "The other player has left the game."
"COG_01006" 0 "Unfriendly Mode"
"COG_01007" 0 "Time Limit = "
"COG_01008" 0 "Score Limit = "
"COG_01010" 0 "Gold Scored!"
"COG_01012" 0 "Red Scored!"
"COG_01019" 0 " has "
"COG_01020" 0 " point."
"COG_01021" 0 " points."
"COG_01022" 0 " "
"COG_01025" 0 "The Red player has requested to end the game."
"COG_01026" 0 "The Gold player has requested to end the game."
"COG_01027" 0 "The game was called on account of something."
and update the message count.
Okay, you're done! Now go save your JKL and go test out the level... if you've done everything just as I said, it should work!