Advertisement

Tetris or Galaga in C++?

Started by January 24, 2003 02:49 PM
7 comments, last by lanchfn21 21 years, 9 months ago
Hi all, I''m new here and just have a quick question for anyone willing to answer. I''ve been learning C++ for about half a year to a year now and was wondering if it is possible to make a Galaga or Tetris type game using Microsoft Visual C++ (specifcally ver 6.0). I dont really think I am ready for that quite yet though. I just recently got the idea to try and make a poker or blackjack game. I think that might be a little bit eaiser. But as i think about that I don''t know how I would deal out the cards. Would I need some sort of random number generator, or would I just assign each card a number and then some how have the program pick differnt numbers to deal the cards? I''m not really sure on how the whole random numbers process works. So if anyone could elaborate on any of the above questions and comments it would be much appreciated. thanks a lot
Yes, it''s possible to do Tetris or Galaga using Visual Studio. You will need to download some graphics libraries, such as DirectX, SDL, or OpenGL. The only one I''ve used so far is SDL, which you can get at www.libsdl.org.

Anyways, I made a blackjack program for my C class last term. It wasn''t too difficult. I just made an array with 52 integers for the deck, then used a random number generator to handle dealing out the cards. It worked, but it ran slowly. I''d show you my source code, but I don''t have it on this computer. I don''t remember how the random function works in c++, but I know you''ll need to include time.h, and maybe math.h... I''m sure someone else can help you out much more than I
Advertisement
A few weeks ago I began my first real game, tetris. I''m writing it using Visual Studio .Net, utilizing the DirectX 9 library. Even though I read a book on programming with DirectX, I didn''t want to take the time to write my own engine, so I got a great open-source one from http://dxframework.sourceforge.net/. I''d suggest you take a look. Best of luck to you.

"Ignorance is the sin of the many, whereas knowledge is the salvation of the few."

Aanidaani
"Ignorance is the sin of the many, whereas knowledge is the salvation of the few."Aanidaani
I am making a Tetris with my group also. We are using Visual C++ 6.0/DX 7. What i can tell you is: it is NOT too hard!. What you need is: Basic DDraw (if using DX7)knowlege, DirectInput (or not), a background for your game area and a cube bitmap to create your shapes (7 shapes) and that's all!

[edited by - Tran Minh Quang on January 24, 2003 11:53:26 PM]
Galaga would be a refreshing change from the classic tetris clone I'd gladly test it to, I loved that game, and shooters in general. I think that's why I like Quake, since the shooter scene has been dead for years. Speaking of which - Quake III was written with MSVC6. I think it can handle Tetris and Black Jack

Luckily for you, a text-based black-jack game is a arch-typical comp sci example, and there's actually a std::random_shuffle algorithm in the STL, that was made with this task in mind. #include

[edited by - Magmai Kai Holmlor on January 24, 2003 12:01:24 AM]
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
What''s Galaga?


tcache
Contact Me
-----------
AH! MY BRAIN IS GOING TO SELF-DETONATE! -- Yours Truly (Jan, 2003)
tcacheContact Me-----------AH! MY BRAIN IS GOING TO SELF-DETONATE! -- Yours Truly (Jan, 2003)
Advertisement
I''m excited to say that today I completed about 90% of my first game! It''s a really simple game and not all that difficult or fun to play, but it''s pretty humorous and I got to put to practice the things that I learned in "Windows Game Programming for Dummies". I made a sprite of GW Bush in a crop duster airplane at the top of the screen and Bin Laden running around at the bottom of the screen. The player controls Bush and moves him left or right. Bin Laden moves randomly at the bottom. The player hits the space bar to have Bush drop a bomb trying to hit OBL. I know it''s silly, but I can finally play something with graphics (animated at that!) and say: "I made that!"
quote: I completed about 90% of my first game!


You know what they say once your done with the first 90% you have 95% more to go..
Opengl is great for stuff like this. Currently, I''ve done mastermind, tetris, breakout, a little rpg, and the start of a 3d engine. I''ve messed with DX a little bit, but it seems harder to me. I''ve been trying to learn it for a few weeks, and I would figure it would be easy, considering that I''ve been programming with opengl since last may, and I consider myself decent at it, but it is still pretty hard. Some don''t think so, but I do. Opengl is easier for me than sdl or directx, but that''s just my opinion. Of course, it doesn''t make model loading, texture loading, and stuff as easy as DX. Also, DX has all of the cool math stuff in it''s library (quaternions and such). The directx library certainly is powerful, and I hope I can get as good with it as I am with opengl. But if you want my opinion for a beginner, start with opengl. You can get away with using glut or sdl for the windowing stuff, and you don''t even need to learn the windows api for awhile.

This topic is closed to new replies.

Advertisement