What I've been up to these past few months
by XanthorXIII · 11/17/2009 (9:33 pm) · 2 comments
So over the past couple of months I've been going back to school. This last semester I decided to take a C# Class since that is what I was aiming for in programming. Since I had taken C++/Visual Basic/Java before, I found the C# class to be fairly simple for me as it was an entry level class. So I decided at the same time that I was going to start learning XNA. I picked up a couple of books and started to crack down on it. I decided for a first game that I wanted to tackle an old favorite of mine. Pong.
About the same time my Teacher announced that for the final test we were to turn in a program of our choosing as long as it wasn't any of the other programs we had done all semester. I decided to get my Pong finished and turn that in. Started on October 25th and ended on November 16th.
Here is the final product for your amusement. Try it out and let me know what you think about it.
rapidshare.com/files/308388461/VideoTennis.zip
Run the setup.exe to install. You may be promted to download The XNA Runtimes and Net 3.5 from Microsoft.
Video Tennis by Xanthor XIII
Controls
Keyboard
Player 1
W - Move Paddle 1 Up
S - Move Paddle 1 Down
Player 2
Up Arrow - Move Paddle 2 Up
Down Arrow - Move Paddle 2 Down
R - Reset the Game after match over or during the match
Space Bar - Serve the ball to start the game
Escape - Exit the game
Xbox 360 Controller
Player 1
Left Thumbstick Up - Move Paddle 1 Up
Left Thumbstick Down - Move Paddle 1 Down
A - Serve the ball to start the game
B - Reset the Game after match over or during the match
Back Button - Exit the Game
Player 2
Left Thumbstick Up - Move Paddle 2 Up
Right Thumbstick Down - Move Paddl 2 Down
The game will start when the serve button is pressed. After that point the ball will move toward the opponent. If the opponent hits the ball it will be sent back towards the other player. It will continue doing this until the ball is past a paddle. When that occurs a point will be added to the score of the player who got it past their opponent. The ball will automatically be served from the player who scored the point. This will continue until one player scores 15 points at which they will be declared the winner. Pleae be aware there is a funny glitch that occurs when the end of the paddle catches the ball. It will cause the ball to behave erratic. It's kinda funny to watch. I know this isn't perfect and any non-constructive criticism will be ignored. If you have contructive criticism I will be interested in what you have to say. I just may not work on this much more as I want to move on to bigger and better things.
*Hint* Torque X 2D.
Thanks and have a great day!!!
Xanthor XIII
AKA Stephen Jolly
About the same time my Teacher announced that for the final test we were to turn in a program of our choosing as long as it wasn't any of the other programs we had done all semester. I decided to get my Pong finished and turn that in. Started on October 25th and ended on November 16th.
Here is the final product for your amusement. Try it out and let me know what you think about it.
rapidshare.com/files/308388461/VideoTennis.zip
Run the setup.exe to install. You may be promted to download The XNA Runtimes and Net 3.5 from Microsoft.
Video Tennis by Xanthor XIII
Controls
Keyboard
Player 1
W - Move Paddle 1 Up
S - Move Paddle 1 Down
Player 2
Up Arrow - Move Paddle 2 Up
Down Arrow - Move Paddle 2 Down
R - Reset the Game after match over or during the match
Space Bar - Serve the ball to start the game
Escape - Exit the game
Xbox 360 Controller
Player 1
Left Thumbstick Up - Move Paddle 1 Up
Left Thumbstick Down - Move Paddle 1 Down
A - Serve the ball to start the game
B - Reset the Game after match over or during the match
Back Button - Exit the Game
Player 2
Left Thumbstick Up - Move Paddle 2 Up
Right Thumbstick Down - Move Paddl 2 Down
The game will start when the serve button is pressed. After that point the ball will move toward the opponent. If the opponent hits the ball it will be sent back towards the other player. It will continue doing this until the ball is past a paddle. When that occurs a point will be added to the score of the player who got it past their opponent. The ball will automatically be served from the player who scored the point. This will continue until one player scores 15 points at which they will be declared the winner. Pleae be aware there is a funny glitch that occurs when the end of the paddle catches the ball. It will cause the ball to behave erratic. It's kinda funny to watch. I know this isn't perfect and any non-constructive criticism will be ignored. If you have contructive criticism I will be interested in what you have to say. I just may not work on this much more as I want to move on to bigger and better things.
*Hint* Torque X 2D.
Thanks and have a great day!!!
Xanthor XIII
AKA Stephen Jolly
About the author
I'm with TGB and it's distant cousin TX2D
#2
Thanks for trying it out. It's not using anything fancy for the collision. Just a simple if Object 1 Intersects Object 2 using a Rectangle Object to detect the Intersection. I'll have to look into the SAT that you suggested however I'll probably end up in TorqueX pretty soon when I start working on a new game.
11/18/2009 (10:44 am)
Alex,Thanks for trying it out. It's not using anything fancy for the collision. Just a simple if Object 1 Intersects Object 2 using a Rectangle Object to detect the Intersection. I'll have to look into the SAT that you suggested however I'll probably end up in TorqueX pretty soon when I start working on a new game.
Torque Owner Alex Stittle
For that ball jumble thing, I'm not sure what collision detection you are using so I can't say for sure why the ball is going crazy. Looks like the ball isn't being pushed out all the way for whatever reason and getting caught again inside the paddle. Maybe you are doing the collision based on direction? So when it doesn't get pushed out all the way the direction is reversed, collision again pushes it back the wrong way, repeat... just a guess, I had a similar problem when I made a pong game once.
If you're not already using SAT (Separating Axis Theorem) to determine the collision and the direction vector to push the ball out, you can try it out as a physics exercise. Or, you can forget about it and jump to TorqueX and have it done for you! :D