View Full Version : My second game!
Vicious
05-12-2002, 08:33 PM
I was bored one night so I said "hmmmm..."
Then I was looking through some board games and saw connect four:
:confused: :eek: :rolleyes: :D
So i sat down typed all night, got up in the morn and by dark the game was done. It is 1 or 2 players. The Ai is pretty good too.
Here is the 4600 line: Four Connections
Vicious
05-12-2002, 10:22 PM
Don't every one jump in on this at once here...
:(
TechWins
05-12-2002, 10:58 PM
Good job, and you did all of this in one night?
But your AI doesn't recognize when there is a OO_O situation. It should fill up the _ spot.:p
Vicious
05-12-2002, 10:59 PM
IT DOESNT???? Oh crap.
Well I did all except the AI in a few hours and the next morn it took me about, 5hrs to do the AI.
TechWins
05-12-2002, 11:11 PM
IT DOESNT???? Oh crap.
yeah but it might have just been in that particular situation...I only played two games...the first one the game messed up because I pressed O instead of a number and it got stuck in a loop to where no matter what I entered it wouldn't continue. The other time was the situation I listed. I would play a few more times, but I have to write a long essay still so I don't have a lot of time right now, plus I want to do a few other things that aren't boring like having to write an essay.
Well I did all except the AI in a few hours and the next morn it took me about, 5hrs to do the AI.
Well, I'd say that you have some dedication to be able to do that in two days!:eek:
Vicious
05-12-2002, 11:14 PM
But now I cant think of what to do next...
Oh good luck on that essay... AHAHAHAHA...
[cough]
K im better.:p
TechWins
05-12-2002, 11:18 PM
yeah thanks...wanna do it for me...oh wait that isn't allowed is it...d@mn!;)
you could learn an API (win32 API is recommend for your first API), you could go more indepth with the 'basics' of C++, you could make a pac-man game, you could make a frogger style of game, you could make a snake, you could can do many things...the possibilities are endless...well at least they are endless once you can do graphics.:)
Vicious
05-12-2002, 11:20 PM
Isnt that Windows programming?
And how do I do graphics in Dos Games???
:confused:
Vicious
05-12-2002, 11:22 PM
oh I made a little thingy like this
0***
****
****
****
The you can eat up the thingies. But that was hundreds of lines just for that!
:(
TechWins
05-12-2002, 11:30 PM
Isnt that Windows programming?
yeah, but I know that a lot of people recommend it for learning your first API. The more advanced APIs that are popular are DirectX, OpenGl, SDL, Allegro, and a few others.
And how do I do graphics in Dos Games???
well, techinically you can't but if you get creative you can create some pretty cool things.
Go here (http://www.cprogramming.com/cboard/showthread.php?s=&threadid=17438) and go about half way down the page to download red_baron's game. You'll see that he made some creative use out of changing colors and using creative characters.
This page (http://www.asciitable.com/) has some really cool info on ASCII values to where you can use characters that aren't present on your keyboard.
Vicious
05-12-2002, 11:33 PM
So ill be making text based games until I can program games for Windows????
:eek:
But what about old games like
Doom wasnt that run in dos?
Or a full screen window?
If I must try and learn Windows programming, Anybody got any ideas where to get started?
Vicious
05-12-2002, 11:35 PM
you can use characters that aren't present on your keyboard.
Yah I accedently assigned 1 to an array instead of '1' andit print out a smiley
:)
ErionD
05-12-2002, 11:37 PM
www.winprog.org
www.sunlightd.com
Get Petzolds Windows Programming book.
TechWins
05-12-2002, 11:41 PM
So ill be making text based games until I can program games for Windows????
Well, you'll be making text based games (using the console app) until you learn an API. The Win32 API is just one of the many APIs you can learn. I suggested it because it's recommend that you learn the Win32 API first. I guess it's easier than the other APIs to learn or sumpin. I really don't know much about it, sorry.
Doom wasnt that run in dos?
No idea.
If I must try and learn Windows programming, Anybody got any ideas where to get started?
Well, you'll still be using C++ with any API that you use, so you don't have to worry about. Although, learning an API is kinda like learning a new language (on top of what you already know and will be using (C++) ) in that you have to learn all of the new variable names and functions. You can go to gametutorials.com for some good Win32 API tutorials. I downloaded a bunch of them, and looked over them but I decided that I would be better off getting myself more familiar with the 'basics' of C++ first. It might be best for you to do the same, too.:)
Vicious
05-12-2002, 11:44 PM
Oh well im still pretty lost.
:rolleyes:
API's arent just like header files??
And will I be using the int main() any more or will this be completely new?
Ah ill go to gametutorials and see whats there.
Vicious
05-12-2002, 11:46 PM
Wat do you mean by the basics of c++. Like classes and stuff?
I wouldnt know what kind of program to make with all tose things
:confused:
Vicious
05-12-2002, 11:56 PM
OK BASICS OF C++
Needless to say i just looked at the tutorial.
:rolleyes:
JoshG
05-13-2002, 04:12 PM
I think Allegro is easier to understand than Win32 API. Allegro can be found at http://www.talula.demon.co.uk/allegro/, there is a Allegro package for Dev-C++ out there somewhere, search google.
Jet_Master
05-19-2002, 08:16 AM
is there a programming language that is WAYYYYYYY easier than C or C++ or C# and is much powerful?
let me know if there is anything on your mind
Invincible
05-19-2002, 03:01 PM
is there a programming language that is WAYYYYYYY easier than C or C++ or C# and is much powerful?
In terms of ease and power, C++ is the best language all around. Java is more robust, but it has nowhere near the creative freedom of C++. It definitlely does not have the raw speed of C++.
Doom wasnt that run in dos?
API graphical processes are low-level functions that access the hardware directly via assembly language and Mode 13h or ModeX. Most DOS based games were done in this fashion when no API's were available to perform these low-level functions. If you want to write your own low-level functions and develop API's learn assembly. Else, learn DirectX or OpenGL.
SDL is a good 2D library that hides the complexities of other API's from the coder, and it can be used alongside OpenGL for 3D. Both are highly portable as well.
Hope this helps.
Nutshell
05-20-2002, 07:08 AM
your Game still has a weakness. You have to make sure that the Ai doesn't put a piece where it would help the opponent to win next round. Hava look at my connect 4 game. Or..hav u alreadY?
Bye
Hunter2
05-22-2002, 02:39 PM
... not int main(), but "int WINAPI WinMain(HINSTANCe hInst (...)"
Driveway
05-22-2002, 03:11 PM
I got the AI beat on my second game for me going first, first game for AI going first.
If you go first:
Move 1: 4
Move 2: 2
Move 3: 6
Move 4: 3
Move 5: 4
Move 6: 5
You Won!
If AI goes first:
Move 1: 2
Move 2: 6
Move 3: 3
Move 4: 4
Move 5: 6
Move 6: 5
You Won!
Well done Vicious. But I always beat the AI.
Vicious
05-25-2002, 12:37 PM
Thanks everyone.
And as far as the AI goes...
I didnt plan on making it invincible.... or extremely difficult for that matter.
I wanted a AI that would play... Make a few... er several mistakes and lose sometimes.... and win sometimes.
Invincible
05-25-2002, 01:24 PM
I was following up on Tech's replies.
Jet_Master
05-27-2002, 08:05 AM
There is a BUG in your game
i have put a screenshot of the gamewhen the bug occured. look at the x in column 7. it is hanging in mid-air...
Jet_Master
05-27-2002, 08:10 AM
There is a BUG in your game
here is the attachment
Jet_Master
05-27-2002, 08:12 AM
and when i put my "O" in 7, it went beneath the x that was hanging in there.
here's an attachment:
Vicious
05-27-2002, 12:06 PM
LOL... I had so many of those bugs..
I thought I found them all..
Klinerr1
07-14-2002, 11:50 AM
hey uh, tech wins, your new game light, you sai don your that that you used the allegro library! where can i downlaod the allgro library and learn allegro, i went to allegro.cc like everyone says. but in cant find anything.... and YOU said you cant use REAL grpahics binm dos, but in light you have REAL graphics
TechWins
07-14-2002, 01:29 PM
Well, I'm not really sure why you posted this here, but that's all irrelevant...
You can download v4.02 adn v4.10 from here (http://alleg.sourceforge.net/wip.html), but it appears that v4.10 is being called an "unstable" version, so stick with 4.02.
and YOU said you cant use REAL grpahics binm dos, but in light you have REAL graphics
Sorry but I'm not sure what you're talking about.:confused: I don't use DOS and neither should other people (win2k and above doesn't use DOS). In my game I do have real graphics, because I used allegro as an API and didn't create a console application. It's only in console applications that you can only use ASCII text and nothing else. Other than I'm not really sure what you're asking.
Good luck and the file you want to download is called all402.zip that's if you are running under Windows. the .tar.gz are for Linux users.
dune911
07-14-2002, 01:31 PM
@Jet_Master
Yes, there is a much more easier way to program games:
http://www.blitzbasic.com (but it is also much more lame) :)
if you don't want to code powerfull C, try this blitzbasic stuff
dune911
07-14-2002, 01:35 PM
@TechWins
In which language have you programmed 'Light' ?
Is that plain C or did you made 'Light' using C++ ?
I like red_baron's way of making games in the
console... but how long, do you think, does it take
an apprentice programmer (not a newbie) to make
some nice stuff using any compiler with allegro ?
or : how long does it take you ? are you skilled ? :)
or, better asking for : how long do you code in C ?
TechWins
07-14-2002, 03:14 PM
dune911,
here is my complete programming experience:
-i programmed in pascal for a few weeks back in last november
-then in januaray i started to learn c++ for a few weeks.
in march i started back up learning c++ (and haven't stopped since then)
-i made a console based tic-tac-toe game by the end of march (took me about a week to complete)
-by the end of april i made a console based maze game (the samething as Light but in console and it was much worse) and it took me about two weeks to complete
-in may i pretty much screwed around tinkering with a bunch of programs and learning new techniques and stuff like that
-in june i started to learn allegro. at first i was creating a space shooter but i decided i wanted to do something different first. plus a lot of the code came from the help of JoshG
-by the end of the month i had recreated my console based maze game into an allegro game called Light and it took me about two weeks to complete...a lot of the time was spent on drawing the pictures and learning new things about allegro
-since that time i've been mainly doint the samething i did back in may
-here's some other info about me: i'm decently skilled in c++ but i'm not an expert by any means at all. in fact i don't even use oop. so i guess you could say i made the game using c concepts but with some of the specialties of c++.
for a programmer who has basic knowledge of c++ i think it would be fairly easy to create anything using allegro. in fact i think it makes it a lot easier rather than trying to make a game look good in console. you use all of the same c++ knowledge you know, so it's not really that big of a transition. it doesn't take too long to get used to the functions of allegro, because they're pretty simple. all in all i create games because it's a fun way to learn the language. i can't stand reading, so what i do is create a game. typically i come across something that i need to learn in every game i make (that's one reason why it takes me longer to make my games). basically it's my method for learning c++. it may or may not be the best method, but it's my method and it's working for me.:)
well, i hope i was able to answer all of you questions. if you have anymore feel free to ask.
SpitBall
07-14-2002, 05:56 PM
I was thinking of trying Allegro, but I'm not sure if I'm really ready, since I tried all that Windows programming and was TOTALLY lost, it seemeed like it wasn't even any C++... lol
Da-Spit
07-14-2002, 05:59 PM
Sorry, that was me... lol, I used the wrong username again!
frenchfry164
07-16-2002, 03:24 PM
DOS can not to graphics
that is bull. CONSOLE can't do graphics DOS can. There are many diff ways to do it. Inline assembly is used frequently. I think www.brackeen.com got some tutorials on mode 13h.
TechWins
07-16-2002, 03:34 PM
DOS can not to graphics
Where and who did this quote come from?
Either way, ff is right, DOS can run graphics. Although, I strongly recommend not using DOS, because of all the users who can't run DOS apps (as mentioned before, win2k and winXP users).
Spitball, Allegro is a lot easier than Win32. If you download my game and look at the source code for it you'll realize that it's all the basic C++ code plus a few Allegro specific functions. Allegro is very easy, so as long as you have a little experience with C/C++.
red_baron
07-16-2002, 03:41 PM
techwins do you use win2k or winxp ? :D
TechWins
07-16-2002, 03:52 PM
I use win2k, and I know what you're hinting at.:p
A good example of why people shouldn't use DOS anymore came from gamedev.net about a week ago. Some guy had created a nice looking space shooter game, and the game was in DOS. Since so many people run either win2k or winXP only a few people could play the game. What a shame; the guy worked really hard on the game to only have a few people be able to try the game. I guess if you only want a few people trying your game, then DOS is great to use. Otherwise it't not worth it, using DOS.
JoshG
07-16-2002, 05:12 PM
If he wrote the game in Allegro, it would not be hard to make a windows version.
frenchfry164
07-17-2002, 05:09 PM
Steps into making an Allegro game into Windows.
Get a windows compiler. Make a new project. Put in all your source files. Hit the Build All button.
Unless you are using something DOS specific like SVGA graphics or Sound Blaster, then all you have to do is change one or two lines around and switch it to autodetect or directx
vBulletin® v3.7.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.