Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple game source

Status
Not open for further replies.

denisfinn

Programmer
Jun 7, 2003
49
US
can someone give me the source of a simple game like pong, tetris, or chess.

i just cannot picture how to make a game with c++

thanks :)
 
We need mre info Denisfinn, what do you know, and what graphics api do you understand (if any?)
 
well i guess....

is there one that works both on linux and windows? I do a lot of work on linux too.

I have not worked with either of these parts of programming before.

thanks
 
If you want it to work in linux as well, then I'd guess that you want to learn OpenGL
(Which is supported toa point in Windows, but MS won't be extending their OpenGL libraries directly, you'll need to learn extensions if you wnat to really get into graphics.

I don't have any source code I can offer, but what exactly is it you want to know. as this is the MS forum, I take it that you can code already in MS C++, butr to what level. Do you understand how to use MFC, or Win32. Can you use direct draw ? Do you understand linked lists etc ?

Sorry if this is all basic and patronising, but like other kinds of programming, there are a lot of basics that you need to go into a game ( I am not saying that you need all of the above, but understanding of 1 or 2 of them may help)

And for the record, Chess isn't a simple game. On other forums I am on, those new to games often start with a tetris, or a pong clone, before moving on to pacman type games to get used to the basics. If you like RPG's I'd maybe consider making a text adventure to get used to designing / coding a structured environment.

Feel free to ask some specific questions and you will find help here. other than that, for simple game source code, you can always google, but code others have written is not often as easy to understand or learn from as something you have designed yourself
 
Hi,

However I've never used it(though I've read some doc about it in order to write a game, in another life :) ), I advise to take a look at SDL (Simple DirectMedia Layer) :

It is cross-platform and you can manage through it other aspects than video only : keyboard, joystick, audio.
It seems to be pretty powerful, and you can read some tutorials in the website. Also there are other projects around it, such as games, many of them should be packaged with their source code.

--
Globos
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top