Translating C++ Tetris tutorial into BlitzMax...

BlitzMax Forums/BlitzMax Beginners Area/Translating C++ Tetris tutorial into BlitzMax...

lesslucid(Posted 2010) [#1]
Hallo,

I've read that creating a tetris game is a good stepping-stone toward writing more complex games. I couldn't find any BlitzMax tetris tutorials so I thought I would pick a nice-looking C++ one and try to "translate" it into BMax. Um, but since I don't really know what I'm doing I thought I'd ask for a bit of advice here to stop me going down blind alleys. I don't want anything done for me - working it out myself is part of the learning, I think - and when I finish I'll try to write it up and maybe post it over in the tutorial forum. Anyway, my first question...

The tutorial I'm using is over here. The first section is a long list of arrays-of-arrays for the various tetronimoes. I thought I'd go a slightly different route and what I've produced sort of looks like this:



Does this seem like an OK way to go about it?


Jesse(Posted 2010) [#2]
c++ or any other language that illustrate principal is good enough.
what you want to get out of tutorials is the logic for creating a game. if you are copying the code with out really understanding the logic it is not going to do you much good. I suggest you look at the original code study it enough to understand it then try to create your own. also after analyzing it, try to figure out how to improve what the original designer did it's not always easy but helpful for learning in the long run.

you forgot to add "End Method" ;)


Czar Flavius(Posted 2010) [#3]
You could extend the different shape types from an abstract TPiece.


lesslucid(Posted 2010) [#4]
Jesse - thanks for picking up the "end method" - spotted it myself just now but I guess this is what happens when you don't start with code that you can run and test.

Do you think I should try to understand the whole of the tutorial before I start coding anything?

Czar Flavius - I could; I even understand enough to know how to do that! Would that be more logical? I thought that maybe it would be easier to keep straight if there was just a single piece "type" and then a variable inside it to tell it what kind of piece it is, but... I guess while I've more or less understood the syntax of creating types I still haven't quite worked out the principles underlying what the best way is of dividing or subdividing the various... logical components of them.


Czar Flavius(Posted 2010) [#5]
It wouldn't make much difference logically, but it would be more fun :)