Bastris 2

edited June 2014 in Sinclair Basic
Following on from this thread I've lashed together a new version of Bastris - the little tetris clone I did in Speccy basic in 2002. This version should have working keyboard input on all speccies, and runs faster, 'cause I took my own advice and removed all the unnecessary multiplications, etc.

This zip file includes the commented source in a BASin-friendly BAS file, and TAP and TZX files. I doubt it's really that interesting to anyone here, but after unearthing the original code, I wanted to do a fixed version just for the sake of completeness.

I'm sure it could be further speeded up, but it's reasonably playable (for a BASIC game...) as it is now. EDIT: It still has the crap title-screen music, by the way :D

Big shout out to Dunny for BASin. I've never really used it properly before but it really is a great utility.
Post edited by ccowley on

Comments

  • edited June 2014
    Better than any of my BASIC efforts!...

    Hey, the music isn't THAT bad!... How did you do the music then?...(by hand?)...
  • edited June 2014
    kgmcneil wrote: »
    Better than any of my BASIC efforts!...
    Well I think the keyboard reading is still a bit screwy... I must have used IN instead of INKEY$ with the idea of supporting multiple simultaneous keypresses, but didn't follow the idea through properly. Ah well... maybe I should call it a CSSCGC instead and have done with it! :D
    Hey, the music isn't THAT bad!... How did you do the music then?...(by hand?)...
    It really makes me cringe! Can't really remember the details as it was too long ago, but I would've done it by hand - certainly no additional utilities involved in that monstrosity :)
  • edited June 2014
    Some feedback :
    It flickers alot, sometimes even the piece disappears, controls take a long time to respond, it does not work in 128k
  • edited June 2014
    hikoki wrote: »
    Some feedback :
    It flickers alot, sometimes even the piece disappears, controls take a long time to respond
    Yeah, it would do - it's written in speccy BASIC :lol:! The piece disappears completely when you hit the DROP button ("A") until it lands because that's how it speeds up the dropping action -- the pieces are always dropping at the maximum achievable speed during normal gameplay, so stopping drawing them until they hit the deck is the only way to speed it up.

    If anyone has ideas for making it any quicker, I'm happy to give them a try :)
  • edited June 2014
    There you have tetris programs coded in ancient basic, some of them are said to work quite fast.
    Tetris in c64 basic
    20 Lines Tetris in vic20 basic
    Tetris games in TI-83/84 basic
    From my steep ignorance, what if you don't erase the piece as if it was a comet leaving a trail of dust ?
  • edited June 2014
    hikoki wrote: »
    There you have tetris programs coded in ancient basic, some of them are said to work quite fast.
    I dunno what to tell you - it's pretty-much as quick as I can make it, but I know there are some people here who are very good with Sinclair BASIC. It would be interesting to see if there's a better/faster approach than the one I've taken... Maybe we should have a "Write a Tetris clone in Speccy BASIC" competition. Then everyone can really show me up!
    From my steep ignorance, what if you don't erase the piece as if it was a comet leaving a trail of dust ?
    If I understand you correctly, I think that will be slower because you have to keep track of the list of blocks to erase once the piece has hit the deck (the blocks have to be erased at some point, because the collision detection is based purely on the attribute data).

    Probably, I should make some bold (and entirely false ;)) statement like "This is the most efficient way to implement Tetris in sinclair BASIC. It is impossible to do a faster version without resorting to machine code," as I can guarantee that'd prompt someone into making a better attempt at it than mine :D
Sign In or Register to comment.