Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Another Update (Tetris)

Reply to topic
Author Message
Chris
  • Guest
Reply with quote
Another Update (Tetris)
Post Posted: Mon Mar 20, 2000 2:46 am
Again, sorry for being off topic. This message was aimed for Zoop and the GURUs out there who wanted me to do a Tetris clone.


Key
----
* = I can do
_ = I can't do
----

(*)I can rotate the pieces in memory
(*)I can merge the piece into the map
(*)I can render the memory map into a grid display
(_)I can rotate the pieces and keep them aligned
(*)I can scan the map to check for complete lines

4 down, 1 to go...

----

Man, I'm so close to getting this thing done! All I need to do is get the pieces in alignment, randomly add blocks into the map, and merge the blocks onto existing blocks. The only thing that's keeping me back now are my keyboard routines!! Ahhh, I could scream! I need to figure out a way to check the keyboard without my entire program freezing everytime. I'm using getch(). I think I'll spend the next couple days in assembly testing and making a little keyboard routines (module) so that way I'll never have troubles with fast keyboard input again.


If anyone's interested, I've got a little work in progress. The movement is herky-jerky, the piece can't move down on it's own (stupid ANSI keyboard routine), but you can rotate it and stuff and it's enough to show what I've acomplished so far on my own. This includes my own Assembly Video routines, my rendering engine, and my overall code (no Allegro, DJGPP, etc).

Chris :o)
 
  • Site Admin
  • Joined: 25 Oct 1999
  • Posts: 2029
  • Location: Monterey, California
Reply with quote
Post Posted: Mon Mar 20, 2000 3:47 am
Quote
> Again, sorry for being off topic. This message was aimed for Zoop and the GURUs out there who wanted me to do a Tetris clone.

Hey, as long as it concerns your life, it's on topic.

Quote
>
> Key
> ----
> * = I can do
> _ = I can't do
> ----


> Man, I'm so close to getting this thing done! All I need to do is get the pieces in alignment, randomly add blocks into the map, and merge the blocks onto existing blocks. The only thing that's keeping me back now are my keyboard routines!! Ahhh, I could scream! I need to figure out a way to check the keyboard without my entire program freezing everytime. I'm using getch(). I think I'll spend the next couple days in assembly testing and making a little keyboard routines (module) so that way I'll never have troubles with fast keyboard input again.

...er, what compiler are you using?
Most DOS C compilers offer a (non ANSI) routine called kbhit(), which I think was introduced by Borland. Call it, and it'll return true if there's a character in the input buffer (i.e., if a key has been pressed) and false if not. (or maybe the other way around.. it's been a while since I've done any command line programming)
Route around for a conio.h in your includes. Or beter yet, just try this:

int main()
{
while(!kbhit())
{
printf("I'm waiting...
");
}
return 0;
}




Quote
>
> If anyone's interested, I've got a little work in progress. The movement is herky-jerky, the piece can't move down on it's own (stupid ANSI keyboard routine), but you can rotate it and stuff and it's enough to show what I've acomplished so far on my own. This includes my own Assembly Video routines, my rendering engine, and my overall code (no Allegro, DJGPP, etc).

I'd recommend learning some of those allegro routines and using that for your input, output, display, sound, etc... and then just focusing on the business of writing a game, which is where the real valuable experience can be found.
  View user's profile Send private message Visit poster's website
Chris
  • Guest
Reply with quote
Post Posted: Mon Mar 20, 2000 7:22 pm
Quote
> Hey, as long as it concerns your life, it's on topic.

Zoop, will you please take my name from the top paragraph!

Quote
> ...er, what compiler are you using?
> Most DOS C compilers offer a (non ANSI) routine called kbhit(), which I think was introduced by Borland. Call it, and it'll return true if there's a character in the input buffer (i.e., if a key has been pressed) and false if not. (or maybe the other way around.. it's been a while since I've done any command line programming)
> Route around for a conio.h in your includes. Or beter yet, just try this:

Yes, kbhit() will tell you if a key was pressed but it won't tell you which key. I tried using that as well as getch() and it worked to a certain extent but it still froze when you held down a key.

Quote
> I'd recommend learning some of those allegro routines and using that for your input, output, display, sound, etc... and then just focusing on the business of writing a game, which is where the real valuable experience can be found.

Again, I don't want to feel that I have to depend on other things people have coded. That's my whole reason for writing my tetris with my own routines. I want to learn how things *really* work and then I'll take the pleasure of using Direct X or Allegro.

(I know how if you check for interrupts and values from port 60 that you can read from the keyboard. I just haven't gotten around to writing my own routine for it.)

Chris :o)
 
Reply to topic



Back to the top of this page

Back to SMS Power!