Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

dcgeek

How to write a game

This topic is 5809 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m new to game programming, so therefore: Where can I find a simple tutorial about how to write a game like pacman and/or ping pong, with simple graphics (NOT using SDL, can''t use SDL in Dev-C++). It have to be a tutorial about game programming in both console mode and Win32 API.

Share this post


Link to post
Share on other sites
Advertisement
Your best bet is to start small. A tutorial might help you learn new programming techniques, but it''ll mostly be gibberish if you''ve never touched C/C++ before.

However, I''m assuming you''re at least familiar with the basics of programming in C/C++, juging from your post. You might want to look for some open-source games to examine the code. That''s a pretty good way to learn if you don''t want to have a tutorial leading you around by the hand.

Share this post


Link to post
Share on other sites
quote:
Original post by dcgeek
(NOT using SDL, can''t use SDL in Dev-C++).


Why can''t you use SDL with Dev-C++? Works fine for me...



"Discipline is never an end itself, only a means to an end." - Robert Fripp

Share this post


Link to post
Share on other sites
SDL works in Dev-Cpp for me, perhaps you didn''t installed it properly or something. It took me about 5 days to get it to work but it is fine now.

Share this post


Link to post
Share on other sites
All the other articles at http://www.gamedev.net/reference/start_here/ is only for making
games in DirectX. I want to write games using OpenGL (in 2D), because i don''t want to use so much time to download the DirectX SDK, and i''ve already learned how to setup and use OpenGL in C++.


Share this post


Link to post
Share on other sites
I''d recommend GLUT as a nice way to cope with all the initialization/windowing BS you have to deal with using OGL.
It also helps making your code portable (e.g. your programs will
compile fine under most OS that GLUT was ported to).

It also helps you focussing on the GAME code, not how to set up a window,render context, message loop and stuff like that.

As for your tutorial questions - yesterday I''ve written a nice little Tetr*s clone for console mode. It just uses five CRT
(C-runtime library) functions (namely _kbhit(), _getch(), printf(), system(), and clock()) and is about 300 lines of code.

I understand that it''s very hard to find a good start in writing games - you only find little pieces you need here and there.
I also miss a _complete_ tutorial that just assumes a little knowlegde in C/BASIC/whatever (e.g. my Tetr*s doesn''t use any pointers, structs or other rather ''complicated'' things) and presents how to actually put all the little pieces together to
make a little game.

Once you''ve _finished_ one (small) game, you will at least most probably know where to start the next time.

I''d send you the code, but it''s uncommented (just a quick hack) and a very good example of how not to write good code - but on the other hand: it works without any errors.

Is there any complete -how-to-write-a-simple-xy-clone- tutorial on gamedev? If not I might consider revising my crappy little program and writing one...

Share this post


Link to post
Share on other sites
actually if you look in Forums you''ll see that Teej wrote a Tetr*s tutorial but with "complicated stuff". I would like to see your Tetr*s code though. Without pointers, structs... and 300 lines of code, sounds impressive, but what do I know ...

Share this post


Link to post
Share on other sites
Unfortunatly "search" is disabled so...
Actually I cheated a bit - the code is exactly 328 lines

Feel free to download it: Here

But be warned the code is - as mentioned above - undocumented and far from being 'clean'. It compiles fine under Windows and should (if the system()-call is changed to system("clear")) work on Unix/Linux platforms as well. It uses parts of the C++ STL
now instead of some for-loops and printf(), but imo that's not much of a difference.

Have fun,
Patrick


typo...

[edited by - darookie on November 21, 2002 1:34:14 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!