Advertisement

BASIC game

Started by September 26, 2001 08:23 PM
6 comments, last by bigbadfunkdaddy 23 years, 2 months ago
I am trying to create my first game. I am programming in a form of BASIC, and I want to know what I need to do. I am making a simple tetris clone. i only want to make it single player and even if it didnt have different levels of difficulties, that would be fine (i would prefer 2 or 3 levels of difficulties, but I dont know how i would to that). As you know, programming a game and making an application for other purposes are different from each other (at least right away). I have no idea how I should program this (how the loops functions and everything should be or how they are even implimented in the code). Please help me. Don''t just say "Go to the ''For Beginners'' section on this site. It will tell you everything." I have been there numerous times. It doesn''t tell me what I need to know. Please tell me what I need to know.
If you need that much help It may be time to hit the book store.
There are lots of game design books that deal with the way a
game program should be structured. Including the main loop, when
to check your input. that sort of stuff. A forum is a good place
to get advice and some direction but it''s not great for getting
large amouts of specific information. You need articles, books,
and maybe someone to help guide you through the mess. We are more
the tips and tricks section of the development world. We are not
so good at teaching. with that said I''ll try and see if I can
lend some help. You will need something like photoshop to create
your graphics. You can probably use directx if you are using VB
for your graphics and input. The logic of the prog will probably
look like somethin like this.

Start aplication and initalize graphics
load graphics and sound
start game
check you input
act on input
has piece fallen?
if so cheak for any lines to remove.
if not move piece down.
is the level full? if so end game
if not repeat the whole thing.

Thats kinda raw but sorta the idea.
As for the difficulty levels that should be very easy.
Speed is the main factor in that kind of game and
for this type of game you will probably need to slow it down
alot. When you want the difficulty to go up just stall a little
less. I''m typing this and talking on the phone so I hope it
makes sence and I hope it is of some help.
------------------------------------------------------------- neglected projects Lore and The KeepersRandom artwork
Advertisement
Could you recommend a book on game programming (preferably in BASIC)?
I''m affraid I dont know any good books off hand. The last time
I used basic it was qbasic. That and I''ve just gotten started again
and most of my books are out dated. I know someone else will have
recomendations and if someone does not post in this post start
a new one asking for a good book in the subject. Also This "?"
is asked often so I would say have a look at the old posts on
file and see what might be there. I personaly would suggest you
hop down to the book store if you have one near by. A large chain
like Barns and Noble. If the book is any good they should have it.
Grab a stack and a chair and start reading them right there. After
awhile you will have a favorite that you understand better than
the rest. Thats the one you buy. Differnt people will recomend
different books but some may not work very well for you. Especaly
if the one recomending the book has been programing forever and
reads code like a childrens book. If you don''t have a good store
then wait for a good answer here. I don''t know how useful it would
be but amazon.com lets users rate products. If a book has been around
enough there should be user reviews for it.
------------------------------------------------------------- neglected projects Lore and The KeepersRandom artwork
What is BASIC?
BASIC is fairly old and Im not sure if you would be able to find anything good on it.

PASCAL is also old, but is very easy for this kind of stuff.

Or you could try making one in OpenGL...hmm yummy

Ashman
Advertisement
Basic is a very old programming language which Visual Basic, Qbasic and Dark Basic come from Basic. And a simple way of changing a difficultly level for a tetris game is you change the delay you use to stop the block falling in a microsecond smaller and smaller.

It would be better if you''d post here your specific questions on the subject, not just a "help me", because this way we can''t know what''s your problem, and what isn''t.

But that''s your lucky day , so I''ll give you a tip about how you could organize your code.

I could say a simple tetris game like yours in BASIC you could do the following (I''m not pretending to tell you the best way, but an easy one):

1- Use QBASIC (and not Liberty Basic), and make the program in text mode (it doesn''t look that good but is easier to code in, at first)...

2- Find a way to store which blocks are on and which ones are off (plus a pair of x and y coordinates for the current block).

3- Make a routine that prints the current frame on the screen, using the data defined in the latest point. So that every time you call this routine, it prints out the current frame (in text mode you''ll need a cls or something btw to clear the screen first, and then some locates + prints to fill the blocks).

4- Make a routine that moves the pieces according to the keyboard state, and that does the collision detection, and that defines when the game is over (in bigger games you''d separate the functions a bit more, but for now it can be ok).

4- Now you make the main loop, a piece of code that goes through the frames accross the time while calling the routine 4 and then the routine 3 for every frame....

Start that way, graphic mode and more complex stuff will come later. That simple game in text mode can teach you a lot of stuff, while giving you the chance to really making a complete game.


--DK
--H. Hernán Moraldo
http://www.hhm.com.ar/
--DK--H. Hernán Moraldohttp://www.hhm.com.ar/Sign up to the HHM's developers' newsletter.

This topic is closed to new replies.

Advertisement