My current project has been sending me insane. So, I figured why not make Tetris to take my mind of it. Here it is, the Super Nintendo version. I've included an exe plus the open source mfa in case you want to see how I went about it. I'm not too proud of the code. It is messy, inefficient and poorly commented. However, the gameplay is smooth and bug free. Hope you like it. Peace!
Controls:
LEFT - Move Left
RIGHT - Move Right
DOWN - Drop Block
SHIFT - Rotate Clockwise
CONTROL - Rotate Anticlockwise
SPACE - Pause
ESCAPE - Quit
I love Tetris! Though I am so used to playing 'tetris friends' online that I got used to each colour of the blocks and got confused (I'm pretty obsessed with Tetris) Also a nice addition to their version is by pressing the space bar it drops the block straight down without having to hold down. ANYWAY I love it, and thanks for including the source.
Love the retro style aswell (Which you were aiming for, so ignore the comments about being able to drop blocks at a tap of a button). I felt that the way it was developed was a little odd, only simple things like "is visible" over using a variable, not that it matters, I guess i'm being fussy. But all in all i'm gonna give you a five because as far as I can remember I havent seen Tetris been made on a click product edit: Also, maybe have up/down (up rotates right, down rotates left), just a thought Comment edited by Zephni on 9/29/2011 Comment edited by Rikus on 9/30/2011
Yeah I agree the code is odd. I wasn't too sure how I wanted to go about it so I just went for it. Just made it up as I went along tackling one aspect at a time. There are quite a few work arounds for problems I had created earlier by poor coding and not foreseeing it as being a problem down the track.
The falling piece is the same one object throughout the entire game, changing animation depending on the current piece type. When this piece is placed, it is set to invisible while the appropriate "mini blocks" are placed in it's place and after the "Create time" reaches 0, is positioned back at the top of the screen and displays a new piece. When coding, if I can avoid using a new variable I will. Too many can get confusing. If a task can be achieved by using something else (even something ugly like "is visible") then I'll do it.
I learned a lot making this and I will remake a more efficient version one day. I agree the code in this version is whacky. I left it open purely for educational purposes. Thanks for checking it out! Have a good one
@urbanmonk I had never actualy seen one before, then again I guess ive actualy never looked..
Didn't mean to make it sound like your code was rubbish btw, its good and it works really well I would like to be able to create variables in MMF without haveing to use an object, just like in most programming languages you can say something like 'int varName = 5;' or even just give us an infinite amount of alterable values that we can name that are specific to the program, not an object would be nice. I tend to have a couple of variable objects, that have types of variables in, one for values, one for strings or something.
Everyone has a different way of doing things, who can say what's right and wrong!
Fixed! But don't hope to learn anything from the code. It's complete spaghetti. I can't believe I was ever that bad a programmer. Let alone, only a year ago.