FAQ  •  Register  •  Login

Sprites & ATTR

<<

jonesypeter

Posts: 2

Joined: Sun Jun 26, 2016 8:06 pm

Post Sun Jun 26, 2016 8:13 pm

Sprites & ATTR

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
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Mon Jun 27, 2016 9:07 pm

Re: Sprites & ATTR

jonesypeter wrote: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

Hi, joneyspeter

The function is ATTR(y, x) as in SINCLAIR BASIC. But you must start your program with #include <attr.bas> at the beginning:
  Code:
#include <attr.bas>

PRINT AT 4, 5; INK 6; PAPER 1; "."
PRINT ATTR(4, 5)
<<

britlion

Posts: 766

Joined: Mon Apr 27, 2009 7:26 pm

Location: Slough, Berkshire, UK

Post Mon Jul 04, 2016 4:30 pm

Re: Sprites & ATTR

You can certainly get fourspriter to work - and in fact I did some optimization of it

how-to-tutorials/topic397.html

how-to-tutorials/topic400.html
how-to-tutorials/topic402.html


And don't forget to look in the library: http://www.boriel.com/wiki/en/index.php ... IC:Library

Specifically, have a look at High Res Print, and High Res Print Fast in the library:

http://www.boriel.com/wiki/en/index.php ... Rprint.bas

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.

http://www.boriel.com/wiki/en/index.php ... ntFast.bas

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.

Return to Help & Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.

phpBB SEO