Jump to content
  • Advertisement
Sign in to follow this  
sss_1234

Four in a Row Game

This topic is 2698 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

Hi everyone,

I've now completed a Four in a Row game in C, which is...
- My first C project (my first C project with more than 50 line - 450 non-empty line). I am a Java programmer and created several Java projects bigger than this one.
- My first C project that made of multiple files. It took me a while to understand how to use multiple files in C, but I think I now got it correct.
- My first project with SDL (or any other graphics library, either than Java's default graphics API). I am learning it with the "Lazy Foo" tutorials.
Would you recommend other graphics/game libraries for Linux? (I don't want DirectX or any Windows specific API) - It was a (not-so-pleasant) surprise for me to find out there isn't a function for drawing a circle! Seems to be very low level...
- My first project with Minimax. I didn't program any AI before.
- A project that made me learn to appreciate OOP... haha... My next project is probably gonna be in C++, programming without OOP is annoying!

As such, I'd like to hear comments about any part of game.

The source code is attached.
A bit of explanation about the code:

The "graphics.h" handles graphics functionality using SDL.
A unique feature of it is automatically freeing all SDL_Surface's allocated when loading images. This is done by storing information about every image loading in a linked list structure called SurfaceInfoNode, and then freeing all images in the end of program.

The "gamepaint.h" is used by "main.c" for drawing related to the Four in a Row game.
It uses "graphics.h" for loading and blitting images.

The "logic.h" is used by "main.c" for handling Four in a Row logics.
It includes functions for handling the board and the AI function.

The "main.c" is... main.

Thank you very much,
sss_1234.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • 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!