SRL Archive - Other Scripts

Tetris


Dan Cardin

2009-11-11 15:09:47

Tetris in SCAR…Tadaa! You can either download the .zip, that has the nifty looking (i think) tiles. However, if you dont like that, or dont want to save it, It can be run without them.

I would very much like to thank mixster. He is like my debugging niftily working machine. Very very helpful. Tootoot222 also contributed some of his knowledge, though i haven't implemented it yet.

Im quite sure that this has if not quite a few, some errors. So feedback would be helpful. There is also the matter of the the timing. I basically picked arbitrary places in the score to go up a level, and same thing with how fast each level drops the piece. So if you could give me feedback on how tetris normally does it, or just telling me whether its to long or short would be very helpful.


Finally, my list of hopeful implementations.
  • Menu System - will allow you to pick the level you start on, and whatnot
  • Changeable controls - change which keys you use to do things. I currently have a problem with the input when i tried doing that, so it might or might not happen
  • high scores would be nice
  • a fix to my opening/Game Over sequence. That may or may not show up at the moment.
  • I think a different, more retro-y font would look nice, so i might do something with that.

Controls!
  • wasd - moving piece
  • q - drop piece
  • p - pause

So without further ado.

EDIT: the scoring didnt work, so i fixed that.

Widget

2009-11-11 22:00:01

Tetrises don't give any points D; (when you get 4 rows at once).

Also, either my down key got "stuck" or it's level 16 specifically, but it got impossibly fast :p

Also, I'd recommend converting one of the tiles to a scar text bitmap and then using HSL to generate the rest :)

Dan Cardin

2009-11-12 07:00:57

gosh, i seem to have broken it in an attempt to make my scores work. Well, ill fix that when i get back from school. And generating my tiles sounds like fun =}

mastaraymond

2009-11-12 10:28:00

Finally someone who created the best game ever in scar!

Win win win win win! x 5!

Smartzkid

2009-11-12 12:06:20

I kept getting 'Application Errors' from SCAR. They would come every time I completed a line. In addition, when you complete a line, it doesn't give you a new piece.

Whats with the differring colors on the pieces? I don't approve!

Haha its a nice piece of work though, great work!

Gu3st...

2009-11-12 12:27:05

It gets a bit boring after some time.. :P
and when you get tetrises (widget's word) the same piece as you had before you got the tetris shows instead of the one that it is supposed to show

Dan Cardin

2009-11-12 21:05:52

Well, yes, i am aware of this error upon getting lines. I created it whilst trying to fix the scoring.

Zyt3x - I shall have to look into giving the same piece upon tetrises. What about it is boring? is it just the tetris part, or is something wrong with the game?

Smartzkid - And as for the changing colors, i asked someone's opinion, and they said i should make it random. I added a const for toggling that though. (Though i would eventually like to have all options changeable and savable in game.

And i dont know what the dealio is with your not having any drop. Even after it errored, it always created new ones for me.

EDIT: for now, to make it playable, everyone is bound to level 1. :)

Gu3st...

2009-11-13 02:50:21

You should add some more and harder blocks after level 5, 10, 20, 30 and so on.
some blocks I made:
And make the speed increase for each level

Widget

2009-11-13 03:14:26

From: Zyt3x
You should add some more and harder blocks after level 5, 10, 20, 30 and so on.
some blocks I made:
And make the speed increase for each level


Hint: "Tetr-" means "four", which is how many squares each block is ;)

Gu3st...

2009-11-13 03:16:19

From: Widget
Hint: "Tetr-" means "four", which is how many squares each block is ;)
f*** :<

Dan Cardin

2009-11-13 06:55:29

If you would like such pieces, simply add them to the case in MakePiece (line 18), and add +1 to the Random(7);

-your above pieces
7: temppiece := [Point(0,0), Point(-1,0), Point(1,0), Point(0,1), Point(0, -1)];
8: temppiece := [Point(0,0), Point(-1,0), Point(1,-1), Point(0,1), Point(0, -1)];
9: temppiece := [Point(0,0), Point(1,0), Point(2,0), Point(0,1), Point(0,2)];
10: temppiece := [Point(0,0), Point(1,0), Point(0,-1), Point(1,1), Point(-1,-1)];

and, i dont have enough tiles, so you'll need to set ConCol to false. But other than that it works.

EDIT: and the speed does go up with each level! you are just unable to go past level 1, because the speeding up doesnt work =}

caused

2009-11-13 07:39:22

WOAW . THANKS THANKS THANKS THANKS THANKS THANKS THANKS.

I always wanted to programme tetris in scar : D. But wasn't sure about some procedures. Thanks again :)

~caused

Dan Cardin

2009-11-17 21:34:07

i think i fixed the level issue, and it doesnt out of range anymore.

EDIT: I changed the rotation from being formulaic to being hardcoded to get rid of the effect of when rotating certain pieces, it would be un-nice. I also made the leveling sexier with the help of mixster. And probably a few other things. More error posting would be helpful. (actually, just for now, try not to rotate the |'s when its surrounded on both sides and it straight up and down.)