Posts: 3
Threads: 3
Joined: Jun 2016
Reputation:
0
Hi,
I'm quite new to ZX Basic, and just had a few questions:
Is the replacement for the Sinclair BASIC ATTR command attrAdress(x,y)?
Are there any linked sprite libraries that let you use Sprites (larger than 8*8) from BASIC? I did look at the Spanish Fourspriter tutorial, but Google translate is not great with technical translations. Is there an English Language tutorial, and are there any other libraries, without the need to use Assembler?
Thanks
Posts: 806
Threads: 135
Joined: Apr 2009
Reputation:
5
You can certainly get fourspriter to work - and in fact I did some optimization of it
<!-- l --><a class="postlink-local" href="http://www.boriel.com/forum/how-to-tutorials/topic397.html">how-to-tutorials/topic397.html</a><!-- l -->
<!-- l --><a class="postlink-local" href="http://www.boriel.com/forum/how-to-tutorials/topic400.html">how-to-tutorials/topic400.html</a><!-- l -->
<!-- l --><a class="postlink-local" href="http://www.boriel.com/forum/how-to-tutorials/topic402.html">how-to-tutorials/topic402.html</a><!-- l -->
And don't forget to look in the library: <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Library">http://www.boriel.com/wiki/en/index.php ... IC:Library</a><!-- m -->
Specifically, have a look at High Res Print, and High Res Print Fast in the library:
<!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:HRprint.bas">http://www.boriel.com/wiki/en/index.php ... Rprint.bas</a><!-- m -->
This has an example of moving the gentle sprite around by pixels. It's far from automated, but it's /a/ basis for a sprite routine. It's also possible to use it in OVER 1 mode, iirc, so you can protect the background by merging it and then reprinting the same thing to restore.
<!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:HRPrintFast.bas">http://www.boriel.com/wiki/en/index.php ... ntFast.bas</a><!-- m -->
Same as the original, but uses lookup tables to do screen addressing, rather than calculations. This makes it about 20% or so faster to print a character, but does make the code much larger as the tables take up space.