Thread: Advanced connect four game

  1. #1
    Registered User Ion Blade's Avatar
    Join Date
    May 2002
    Posts
    35

    Smile Advanced connect four game

    Hi..

    this is my first "real" game in c++. It is connect four, only beefed up with features and options. At this stage, only a couple of the options work, and only a few modes work correctly (that's right, there are different modes of play). There are also some bugs in places that i am aware of, and will fix.

    i have included the executable and the source in the zip.

    The source consists of main.cpp, and engfuncs.h which has some of the options menu stuff in it and other functions that are used by main.cpp. I haven't commented much of the code as i didn't expect anyone else to read it, so you might not get how i used the functions etc at first. But, maybe you will..

    Anyway, here it is. This is obviously not my final version.

    I think i should explain the modes first...

    Standard is obviously standard connect four.
    4 player is the same thing, except 4 people will be playing!
    2 on 2 is one team versus another, and you must connect your pieces to your team mate's pieces to win. this mode is not done yet.
    Iron man mode does not end when you get a connect four. Instead, you get a point for each one. when the board fills up, the player with the highest amount of points wins.

    Iron man x2 is the same as iron man, except there are 2 full sized boards to fill up. This mode is not done.

    2 on 2 mode is not at all done yet, and all that exists of it is the team selection menu when you start. after that, the game completely bugs up and gets screwy because i haven't finished it yet.

    at almost any time during the game when you are allowed to type something in, you can also type in a word to perform the action you want. while in a game, you can type back, reset, or restart to go back to the main menu.

    Comments and suggestions are welcome. Thanks!
    "Im going to have peaceful dreams of brackets and semicolons strapped on crucifixes, screaming for mercy" - Someone who doesn't like programming.

  2. #2
    Sir Mister Insane Sako Klinerr1's Avatar
    Join Date
    May 2002
    Posts
    608
    nice with the colors, but you need some computer ai. not everyone has a freind t play against. i can help you write some AI if you aim me.
    Email: [email protected] || AIM: MisterSako || MSN: [email protected]

    -the shroom has spoken

  3. #3
    Registered User
    Join Date
    Jun 2002
    Posts
    44
    Hi,I looked at your code and played your game.Not bad,but could you please explain the cls() function,i mean how it works to clear the screen.I remember seeing DWORD elsewhere but i don't know what it means and the COORD and such,what are those data types and were are they defined?Also,how'd you get the color?
    ego sum via et veritas et vitae -Jesus Christ

  4. #4
    the only thing I can say is.......

    NIIIIIIIIICE!

  5. #5
    Registered User
    Join Date
    Jun 2002
    Posts
    267
    Originally posted by Powerfull Army
    Hi,I looked at your code and played your game.Not bad,but could you please explain the cls() function,i mean how it works to clear the screen.I remember seeing DWORD elsewhere but i don't know what it means and the COORD and such,what are those data types and were are they defined?Also,how'd you get the color?
    The CLS() and gotoxy() both use Win32 API commands to paint the screen with blank spaces (CLS), and set the current cursor position (gotoxy)

    (and if you're a newbie, don't worry about understanding those functions yet... it takes a little time before you really get into Win32 API stuff)

  6. #6
    Registered User
    Join Date
    Jun 2002
    Posts
    44
    so it wouldnt work with dos?Would your program work with DOS only,no windows?
    ego sum via et veritas et vitae -Jesus Christ

  7. #7
    Registered User
    Join Date
    Jun 2002
    Posts
    267
    What you call DOS, is most likely a DOS console... think of it as the DOS inside of Windows, now the thing about it is that Windows is in supreme control of the system so if you're running or making a DOS console program, it's kinda also a Windows program, because Windows is right there watching the console and managing it. The DOS console can do just about everything real DOS can do, except low-level things like talking to the BIOS etc...

    So, since a DOS console is run by Windows, manipulations to the console are done through Windows... which is what he has done in his program

    DOS programs run under Windows
    DOS consoles are running with Windows and emulate DOS
    Windows GUIs are what you're looking at right now

  8. #8
    Registered User Ion Blade's Avatar
    Join Date
    May 2002
    Posts
    35

    Smile

    Thanks for the replies

    Kliner, ai would be pretty cool, but i don't have the will to work on it because it would seem daunting to me. you, or anyone however can try and implement ai into my code and then post your new code, if you want.

    As for the CLS and gotoxy functions, doob has done a good enough job explaining those. What i really did was just copy and paste those 2 functions from this site's faq, and paste them into my code...since i am not great at windows programming yet.

    The scrollprint function i made myself, if you happened to notice it.
    Last edited by Ion Blade; 07-28-2002 at 12:53 AM.
    "Im going to have peaceful dreams of brackets and semicolons strapped on crucifixes, screaming for mercy" - Someone who doesn't like programming.

  9. #9
    Registered User Ion Blade's Avatar
    Join Date
    May 2002
    Posts
    35
    I noticed a bug in the code that would allow 4 players to play in iron man mode if you selected 4 player mode and then switched to iron man. I fixed it, and here is the latest version of the program and code.
    "Im going to have peaceful dreams of brackets and semicolons strapped on crucifixes, screaming for mercy" - Someone who doesn't like programming.

  10. #10
    Registered User
    Join Date
    Jun 2002
    Posts
    44
    doob,im asking if it will run in 16-bit DOS(true DOS).
    ego sum via et veritas et vitae -Jesus Christ

  11. #11
    Registered User
    Join Date
    Jan 2002
    Posts
    387
    it might, but i dont think so, because it is a 32bit exe file.
    (i dont have a true dos box to test it on =\)
    "There are three kinds of people in the world...
    Those that can count and those that can't."

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. New Project, text game, design stage.
    By Shamino in forum Game Programming
    Replies: 9
    Last Post: 05-23-2007, 06:39 AM
  2. Open Source / Semi Open source game idea. Help needed
    By CaptainPatent in forum Projects and Job Recruitment
    Replies: 10
    Last Post: 05-16-2007, 10:44 AM
  3. Game Independent Anti-cheat Project Needs Programmers
    By GIA Project Lea in forum Projects and Job Recruitment
    Replies: 3
    Last Post: 09-15-2005, 07:41 PM
  4. Engine <=> DX/OGL | c++ ?
    By darkcloud in forum Game Programming
    Replies: 6
    Last Post: 05-13-2005, 12:19 AM
  5. Game Designer vs Game Programmer
    By the dead tree in forum Game Programming
    Replies: 8
    Last Post: 04-28-2005, 09:17 PM