Page 1 of 1

Yet another Tetris

Posted: Sun Feb 12, 2017 5:26 pm
by ctr
A couple of threads about Tetris reminded me that I wrote one for the BBC Model B many years ago. Screenshots and ssd are attached.

My impressions after more than a quarter of a century:

Pros
  • * Responsive
    * Smooth animation of falling pieces
    * Fast loading
    * Patterns on blocks rotate with blocks
    * Key selection
    * No sound
Cons
  • * No preview of next piece
    * No pause
    * Boring scoring
    * Acceleration is too slow
    * Clearance bonus causes sudden acceleration
    * Playing area too tall
    * American spelling of preferred
    * No sound
Despite these flaws I think it's quite playable. Give it a whirl!

EDIT: This is the latest version: tetris.ssd.zip

The original version is below.

Re: Yet another Tetris

Posted: Sun Feb 12, 2017 8:03 pm
by pixelblip
I just played your game........very good.........can't be easy writing a game like Tetris. The colours are tasteful. Always liked magenta and yellow!
It's an infuriating game to play isn't it :D
I like the shading you did on the tiles as well...........thanks for posting it up. =D>

Re: Yet another Tetris

Posted: Mon Feb 13, 2017 12:46 pm
by ctr
Cheers, I'm glad you liked it. It is infuriating, I wasted most of Sunday trying to get a good score. I seem to recall young me being much better at it. :-)

Re: Yet another Tetris

Posted: Tue Feb 14, 2017 7:18 am
by FourthStone
Great effort!

Like that no sound is a pro and con haha :lol: Animation is nice and smooth although I did have a few pieces drop 2 in a row at times, might just be a timing thing or my fat fingers but it happened semi regularly.

Love that you can choose your own keys!

Planning to do any further dev work on it?

Re: Yet another Tetris

Posted: Wed Feb 15, 2017 4:57 pm
by ctr
Are you tapping or holding the drop key? You only need to tap it once. If you hold it for the duration of the drop it is quite hard to time the release to avoid a second drop.

I hadn't planned to do any further work on it but I did want to have a look at the code. Doing that on the BBC was painful so I moved it to the PC, and then I made it build in beebasm and then I starting adding a few comments... So I'll see where it goes.

Re: Yet another Tetris

Posted: Thu Feb 16, 2017 7:22 am
by FourthStone
Are you tapping or holding the drop key?
I had another play and couldn't get it to happen if I was careful about not holding the tap button so must of just been the timing thing... something to look at for a future release if you decide develop further, maybe allow a drop only if previous drop key press is released.

Development has become a joy again now that tools like beebasm are available, I love being able to throw code together using modern tools, compile, boot beebem and try it out immediately.

Re: Yet another Tetris

Posted: Thu Feb 16, 2017 7:01 pm
by dgrubb
ctr wrote:Despite these flaws I think it's quite playable. Give it a whirl!
It's really great. Thanks!

Re: Yet another Tetris

Posted: Fri Feb 17, 2017 6:46 pm
by ctr
dgrubb wrote:It's really great. Thanks!
Thank you!
FourthStone wrote:Development has become a joy again now that tools like beebasm are available, I love being able to throw code together using modern tools, compile, boot beebem and try it out immediately
This is so true. I can hit F5 in notepad++ and in less than two seconds the code is compiled and running in beebem!

So I fixed a few of the issues. A new version is attached.
  • * Clear the keyboard buffer when starting a new piece. I hope this will fix the double-dropping.
    * The (extremely rare) clearance bonus no longer affects the speed.
    * Escape now pauses with an option to quit.
    * Correct spelling of "preferred".

Re: Yet another Tetris

Posted: Fri Feb 17, 2017 8:49 pm
by MartinB
Just had a play - it's really good, well done! =D> 8)

Have to report though that I did have about three 'double drops' in the game below...
ctr's tetris 001.png

Re: Yet another Tetris

Posted: Sun Feb 19, 2017 6:23 pm
by ctr
MartinB wrote:Just had a play - it's really good, well done! =D> 8)

Have to report though that I did have about three 'double drops' in the game below...
Thank you!

I'm nearly certain that running on a real beeb a second piece won't drop unless the drop key is still physically pressed.

I think the problem is possibly the latency of a modern keyboard communicating through (possibly congested) airwaves or USB, the OS driver stack, the window manager and the emulator. There could be quite a sizeable delay between a key release and the emulated code becoming aware of it.
FourthStone wrote:maybe allow a drop only if previous drop key press is released
This seems like the right fix. It's a shame I need to alter my code to work around what is most likely an emulation issue, but it's not something the emulator can fix in software.

New version attached.

Re: Yet another Tetris

Posted: Sun Feb 19, 2017 7:54 pm
by Michael Brown
Great to see another game for the Beeb!

The fix you did for the drop is great but could you do the same for the rotate key as under BeebEm your tile spins around mega fast if you keep your finger on the key.

regards,
Mick.

PS Would you mind if I included this game on one of my future games disc compilations?

Re: Yet another Tetris

Posted: Mon Feb 20, 2017 8:27 pm
by ctr
Michael Brown wrote:Great to see another game for the Beeb!

The fix you did for the drop is great but could you do the same for the rotate key as under BeebEm your tile spins around mega fast if you keep your finger on the key.
Cheers. I always regarded the rotation as harmless, but if it's giving people trouble I'm happy to stop it. A new version is attached.
Michael Brown wrote:PS Would you mind if I included this game on one of my future games disc compilations?
Not at all, go ahead. Assuming you're not making a fortune from them! :-)