My first game

Started by
25 comments, last by TheNobleOne 19 years, 6 months ago
Yes I know they use 0 based arrays lol. It is just that when I was coding I kinda had a mind lapse lol. I would have realized it after I looked over my code for changes to make. Also, I would have slaped myself for exceeding the boundries :S

Oh btw I am a first year comp sci major. And we are only into the first semester of the first year lol. I actually hate all the general classes I have to take. I would much rather be taking another course related to my major instead of Philosophy.
My JournalComputer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter. (Eric Raymond)"C makes it easy to shoot yourself in the foot. C++ makes itharder, but when you do, it blows away your whole leg."-- Bjarne Stroustrup
Advertisement
Quote:Original post by Anonymous Poster
Quote:Mode13h


Oh good god! Welcome to 1992. Use DirectX or OpenGL. It's easy.


Yea right, Mode13h is dead, along time ago.At least for commercial games.For a learner/begginer it's still good as an entry level graphics mode.Lot of classic tutorials where the basics of graphics programming are taught are in Mode13h.There's no need to use asm and a decade old code for applying this.You can use the latest 32-bit stuff, under DMPI. Get DJGPP and you can use all the algoritms and other stuff without worrying about old restrictions and much of the memory crap.Once you get into the mode it's almost all the same.After your are comfortable with the basics move on to OpenGL and DirectX.If these are started on early, you might miss a whole load of classic stuff and very simple basics with the APIs doing it for you.

I would not recommend you stick with Mode13h more than for experimentation and for learning,also maybe for a game.320x200 is too small a resolution for fun stff.There's SVGA(horror if you try to program it directly) which offers much higher resolutions,
though I would recommend staying away for it since it's support is nothing like that of mode13h on hardware.

The importance of Mode13h is that it allows you direct access to the screen (video card mem) which allows you to learn/implement various basics in graphics like double buffering,line drawing (drawing algoritms), bmp loading etc. without any help, which will force you to learn a lot of things,unlike being pampered by the APIs.

I do admit Mode13h is a bit difficult if you compare the ease of use of the APIs when it comes to doing tasks like rendering,pic loading etc,but what you really learn about graphics programming is very limited,but you can concentrate on the game programming side.

I been using VGA,VESA modes ,GDI and OpenGL.As far as I am concerned ModeX(VGA) modes are crap when it comes to real world application and of no use except that they give a slight increase in screen resolution and I recommend m13h only for getting direct screen access without any help,so that one can try out various fun basics without going into outdated hardware intrupt code in detail.Just use some code you find off the net to get into the mode.

SVGA is fun too, there's a small bit of good code out there, which is DJGPP specific,so you can use that to gain higher resolutions and a virtual screen, without even once looking at the code underneath.

There are a couple of GUI APIs/Libraries which offers you a linear buffer like the VGA/VESA modes, ask if you want more info will you..

Unless you are willing to brave some waters you will never be able to really learn graphics programming.Game programming you can learn using APIs and I would recommend it too, but most people who really understand graphics programming might recommed you learn rendering techniques too while learning to program games.

[Edited by - FireNet on October 2, 2004 11:36:46 AM]
______________________________________________________________________________________________________
[AirBash.com]
There is a better way: SDL.

Konfu/Thermo
Just a couple of suggestions:

You could use a constant char array to declare and initalize a blank board, and then pass the board by value to make a copy of the board for game play. These provides an easy way to create a new blank board for another game. It also would eliminate a for-loop.

In your StartGame function you can use
while(running == true)
instead of using an if statement and then continuing the loop.

Functions should typically do only one task, CheckForWin would be better if it checked for a winner and returns who the winner is (X O or nobody), and another function PrintWinner should be used to print the winner to the screen. It's seems trivial now, but it's very important in larger programs.

Ideally, the player's turn function should be one function since both players perform the same task and this will make code changes easier, but if it helps you to visualize what's going on, who am I to judge?

Hope these suggestions help.
Imagination was given to man to compensate him for what he is not.A sense of humor was provided to console him for what he is.-Horace Walpole
Hmm, I'd really don't go for mode 13h. Even the Win32 API (GDI) is better and more programmer friendly. So I recommend you to go for either SDL or GDI.

Good work, though! You're right on the track.
http://www.cis.gsu.edu/~shong/oojokes/
on a side note, SDL!!!!!!!!!!!!
Its portable, which is cool. (Especially for us mac people :))
--------------------------------------------------------Life would be so much easier if we could just get the source code.
I am learning SDL :P
My JournalComputer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter. (Eric Raymond)"C makes it easy to shoot yourself in the foot. C++ makes itharder, but when you do, it blows away your whole leg."-- Bjarne Stroustrup

This topic is closed to new replies.

Advertisement