Pong, the CPU paddle
i''m new to game programming, how can i make the paddle artificial intelligence ? thank you
Just make the CPU always move towards wherever the ball is. That really provides a challenging player, and it''s easy.
Anyone know where I can learn how to make a pong game.....I''m not new to C++, just new to the graphics and stuff like pong
April 17, 2002 08:16 PM
I don''t mean to disrespect you Quantrizi and I understand that the graphics can be confusing, but I think the whole exercise of making a game should be undertaken (at first anyways) without any help, so you can try and develop your own strategies. It really does help if you try to do it yourself first. As for the graphics problem, try www.gametutorials.com or the resources section of gamedev
Thanks Puzzler. I just want to look at tutorials to see how it''s done (that''s what tutorials are their for, to learn from)
Step 1: Design your game on paper. You probably don''t need a full-fledged design document for Pong, but you do need to determine the details of gameplay and the requirements for input systems and graphical effects.
Step 2: Choose a platform and API(s). Chances are you''re using Windows. For a Pong game, you could just have two rows of ''|'' characters as paddles hitting a ''*'' back and forth in a console window. Or you could have sprites for paddles and the ball. Or you could require fancy 3d background effects. These things should have been determined in step 1. Now, looking at them, see what you need. If you can just use text, you may want to use standard C++ console IO like cout, or you may want instead to use some faster Windows API console text-buffer functions. If you''re using simple 2d graphics with sprites, you may want to use the Windows GDI, or you may want to use DirectDraw. You might even consider using a 3D api to do this (many people actually do this). If you need hardware 3D, you''ll need to choose between OpenGL and DirectX. Similar decisions need to be made for sound (Windows MMSystem or DirectSound?) and input (Windows Messages or DirectInput?).
Step 3: Design the large-scale program structure based on information from steps 1 and 2. If using C++, this means designing your class interfaces. Do this on paper. Boxes and arrows come in handy.
Step 4: Code it.
Step 5: Thoroughly test and debug it.
Step 6: Beta Test. Since this is an amateur project, this means announcing your by-now hopefully bug-free creation''s birth on Gamedev, and tracking down other people''s problems with the game.
Step 7: Distribute. Take your fixed post-Beta-test code, package it, and distribute it. Since this is an amateur project, this means keeping it posted on your website
Also, the line between steps 6 and 7 are blurry for an amateur project like yours. Similarly, debugging and coding go together.
Also, realize that I too am an amateur, and that these steps are not the Ten Commandments. However, keep in mind the primary message I mean to get out: Plan, plan, plan!
Step 2: Choose a platform and API(s). Chances are you''re using Windows. For a Pong game, you could just have two rows of ''|'' characters as paddles hitting a ''*'' back and forth in a console window. Or you could have sprites for paddles and the ball. Or you could require fancy 3d background effects. These things should have been determined in step 1. Now, looking at them, see what you need. If you can just use text, you may want to use standard C++ console IO like cout, or you may want instead to use some faster Windows API console text-buffer functions. If you''re using simple 2d graphics with sprites, you may want to use the Windows GDI, or you may want to use DirectDraw. You might even consider using a 3D api to do this (many people actually do this). If you need hardware 3D, you''ll need to choose between OpenGL and DirectX. Similar decisions need to be made for sound (Windows MMSystem or DirectSound?) and input (Windows Messages or DirectInput?).
Step 3: Design the large-scale program structure based on information from steps 1 and 2. If using C++, this means designing your class interfaces. Do this on paper. Boxes and arrows come in handy.
Step 4: Code it.
Step 5: Thoroughly test and debug it.
Step 6: Beta Test. Since this is an amateur project, this means announcing your by-now hopefully bug-free creation''s birth on Gamedev, and tracking down other people''s problems with the game.
Step 7: Distribute. Take your fixed post-Beta-test code, package it, and distribute it. Since this is an amateur project, this means keeping it posted on your website
Also, the line between steps 6 and 7 are blurry for an amateur project like yours. Similarly, debugging and coding go together.
Also, realize that I too am an amateur, and that these steps are not the Ten Commandments. However, keep in mind the primary message I mean to get out: Plan, plan, plan!
I''ve had the image in my head for a while now.....but how would I do that in dos.....since
1. dos doesn''t use sprites
2. this is how it could look with the | and * method:
That''s the best I could make with ASCII
1. dos doesn''t use sprites
2. this is how it could look with the | and * method:
_____________| --- || | | || ----- || || || * || || || ------ || | | || ------ |-------------
That''s the best I could make with ASCII
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement