Yay! My First DirectX Game!

This is a discussion on Yay! My First DirectX Game! within the Game Programming forums, part of the General Programming Boards category; WooHoo! I just finished my first DirectX game! Its nothing special really, just a virtual connect 4 board, but hey, ...

  1. #1
    Registered User 4point5's Avatar
    Join Date
    Oct 2002
    Posts
    44

    Yay! My First DirectX Game!

    WooHoo! I just finished my first DirectX game! Its nothing special really, just a virtual connect 4 board, but hey, I DID IT!

    get it here if you want to see it.

    I know its stupid, but its my forst DirectX game and Im proud of it.

    Time to move on to Tetris!

    Thanks to theForger and Sunlight for their great tutorials!
    Don't try so hard. Just let it happen.

  2. #2
    Registered User
    Join Date
    Oct 2002
    Posts
    12

    Thumbs up

    Simple indeed but cool enough, considering its small size!
    A victory check would be cool though.
    Thanks for the tuts, interresting indeed.

    Have a pleasant Tetris coding.
    Last edited by Deltree; 11-04-2002 at 07:47 PM.
    All my brilliant admirable outstanding creations are here:
    http://naderchehab.tripod.com
    take a look!

  3. #3
    Registered User 4point5's Avatar
    Join Date
    Oct 2002
    Posts
    44

    Cool

    I was going to do a victory check, but with the way i programmed it, I would have to make a HUGE switch statement with every possible victory condition. At least I cant think of any other way. Im still new to Game/Direct X programming in a sense, and I just kind of made this game to help me get into DirectX (which is not as hard as everyone makes it out to be ).

    If anyone could tell me any other way of checking for victory conditions in connect 4 I'd be happy to listen.
    Don't try so hard. Just let it happen.

  4. #4
    Registered User Kirdra's Avatar
    Join Date
    Aug 2002
    Posts
    105
    Your not going to include win conditions?

  5. #5
    Registered User 4point5's Avatar
    Join Date
    Oct 2002
    Posts
    44

    Cool

    Like I said in my first post, its just a virtual connect 4 board, until I can figure out an easier way to check for victory conditions.
    Don't try so hard. Just let it happen.

  6. #6
    Registered User Kirdra's Avatar
    Join Date
    Aug 2002
    Posts
    105
    You figured out DirectX but you can't do simple condition checks?

  7. #7
    Registered User 4point5's Avatar
    Join Date
    Oct 2002
    Posts
    44
    Kirda:

    I was going to do a victory check, but with the way i programmed it, I would have to make a HUGE switch statement with every possible victory condition. At least I cant think of any other way. Im still new to Game/Direct X programming in a sense, and I just kind of made this game to help me get into DirectX (which is not as hard as everyone makes it out to be ).

    If anyone could tell me any other way of checking for victory conditions in connect 4 I'd be happy to listen.
    Don't try so hard. Just let it happen.

  8. #8
    Registered User
    Join Date
    Oct 2002
    Posts
    12
    I guess you can use somekind of loop with an array to check victory.
    I'm not sure though, I don't really know how you wrote the game...isn't it open source ?
    All my brilliant admirable outstanding creations are here:
    http://naderchehab.tripod.com
    take a look!

  9. #9
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    Not sure how you are storing the variables that allows the program to know what's where, but if its stored in a 2 dimensional array then you can do it the way I did it in my connect four game. First check the vertical win - easy enough, just look at the three spots under the last move to see if they match the move, only takes one if statement. Then to check the horizonatal win, start 3 spaces to the left of the last move and go right til you are 3 spaces to the right. Count how many checkers are the same as the last move, resetting the counter to zero if you hit a different color checker or a blank spot. If the counter==4 at any time, return a win. Last do the same thing for the diagonal, but just make sure you check BOTH diagonals.

  10. #10
    Registered User 4point5's Avatar
    Join Date
    Oct 2002
    Posts
    44

    Cool

    Yes, I did make it a 2D array, but I always try and do things the hard way for some reason. Thanks for the advice. Expect an update here in a few hours for connect_4 v2.0
    Don't try so hard. Just let it happen.

  11. #11
    Registered User 4point5's Avatar
    Join Date
    Oct 2002
    Posts
    44

    Cool Connect 4 v2.0

    Now with victory checks!

    Get it here.

    Thanks to PJYelton and Deltree for the help.

    P.S. It is open source, just E-Mail me if you want the code, but be warned, its messy as HELL. Use it as a lesson on how NOT to program a game, but hey it was my first shot, and it works. SO BACK OFF!</rant>
    Don't try so hard. Just let it happen.

  12. #12
    eat my shorts!
    Join Date
    Apr 2002
    Posts
    294

    Error

    Not sure if it is just my comp, but anyway tha game doesnt close properly:

    Error:

    CONNECT_4 caused an invalid page fault in
    module CONNECT_4.EXE at 0177:00401e43.
    Registers:
    EAX=004064d8 CS=0177 EIP=00401e43 EFLGS=00010202
    EBX=bff54733 SS=017f ESP=0072fd68 EBP=0072fe38
    ECX=00000000 DS=017f ESI=00000000 FS=33d7
    EDX=830635a8 ES=017f EDI=bff55731 GS=0000
    Bytes at CS:EIP:
    ff 56 1c e8 e5 fd ff ff a1 98 65 40 00 6a 01 6a
    Stack dump:
    830635a8 00000000 00000000 00000000 004064d8 00000010 bff55801 00401f03 00000000 00000000 00620000 00000b1c 00000100 0000001b 00010001 00afeebc



    Try fixing it and release version 2.1
    also try improving user interface

  13. #13
    Registered User
    Join Date
    Oct 2002
    Posts
    12
    Yeah me too, same error. Memory stuff...

  14. #14
    Registered User 4point5's Avatar
    Join Date
    Oct 2002
    Posts
    44

    Cool

    Nope, its a dead project. I only made it to get into DirectDraw. Im am currently working on a tetris type game.
    Don't try so hard. Just let it happen.

  15. #15
    Registered User Diamonds's Avatar
    Join Date
    Oct 2002
    Posts
    68
    email sent

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Win32/2D DirectX Game Programming Books?
    By Darklighter in forum Game Programming
    Replies: 31
    Last Post: 09-19-2006, 09:40 PM
  2. C Programming 2d Array Question
    By jeev2005 in forum C Programming
    Replies: 3
    Last Post: 04-26-2006, 03:18 PM
  3. 2D Game Project with DirectX and C++
    By VMJC in forum Projects and Job Recruitment
    Replies: 4
    Last Post: 12-22-2004, 11:28 PM
  4. Someone help me with this game??
    By stehigs321 in forum Game Programming
    Replies: 15
    Last Post: 10-30-2003, 08:42 PM
  5. My finished game! yay!
    By JTtheCPPgod in forum Game Programming
    Replies: 9
    Last Post: 02-07-2002, 03:09 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21