Beginner's Sprite Tutorial

The place for codemasters or beginners to talk about programming any language for the Spectrum.
User avatar
Seven.FFF
Manic Miner
Posts: 204
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: Beginner's Sprite Tutorial

Post by Seven.FFF » Mon Jan 01, 2018 1:38 am

I've now got as far as preshifting in my tutorial series, in a bit of a scattershod way.

Happy new year!
0 x
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
seven-fff.com/blog

Wall_Axe
Microbot
Posts: 129
Joined: Mon Nov 13, 2017 11:13 pm

Re: Beginner's Sprite Tutorial

Post by Wall_Axe » Mon Jan 01, 2018 4:12 am

you seem to have gotten the multicolor sprite moving smoothly right to left as well as up and down
0 x

MrPixel
Dizzy
Posts: 75
Joined: Sat Mar 24, 2018 7:42 pm

Re: Beginner's Sprite Tutorial

Post by MrPixel » Sat Mar 24, 2018 10:29 pm

is this BASIC or Machine code. if it's the latter, would ZEUS be good?
0 x

User avatar
R-Tape
Site Admin
Posts: 918
Joined: Thu Nov 09, 2017 11:46 am

Re: Beginner's Sprite Tutorial

Post by R-Tape » Sat Mar 24, 2018 10:47 pm

MrPixel wrote:
Sat Mar 24, 2018 10:29 pm
is this BASIC or Machine code. if it's the latter, would ZEUS be good?
Which bit? The sprite code I posted on page 3 is assembly language that the ZX-Spin 0.666 assembler translates into machine code. There are no nobs & whistles so I think any assembler including ZEUS should be fine with it :-)
0 x

MrPixel
Dizzy
Posts: 75
Joined: Sat Mar 24, 2018 7:42 pm

Re: Beginner's Sprite Tutorial

Post by MrPixel » Tue Mar 27, 2018 5:24 pm

i get errors whenever i attempt to call a sprite.
Callsprite drawsprite and deletesprite all get errors

even with the call command
0 x

User avatar
PeterJ
Site Admin
Posts: 515
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Beginner's Sprite Tutorial

Post by PeterJ » Tue Mar 27, 2018 5:50 pm

@MrPixel have you got your simple example working in Zeus first? Zeus has what I call configuration options before the code. @Seven.FFF explains it very well in his tutorial. Get that working first.

Did you write that previous piece of code yourself and do you have coding experience in assembler from your Atari time?
0 x

MrPixel
Dizzy
Posts: 75
Joined: Sat Mar 24, 2018 7:42 pm

Re: Beginner's Sprite Tutorial

Post by MrPixel » Tue Mar 27, 2018 6:21 pm

PeterJ wrote:
Tue Mar 27, 2018 5:50 pm
@MrPixel have you got your simple example working in Zeus first? Zeus has what I call configuration options before the code. @Seven.FFF explains it very well in his tutorial. Get that working first.

Did you write that previous piece of code yourself and do you have coding experience in assembler from your Atari time?
no, from a different section of this site. and i used zx spin 0.666

really wish there was a hot key to assemble
0 x

User avatar
PeterJ
Site Admin
Posts: 515
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Beginner's Sprite Tutorial

Post by PeterJ » Tue Mar 27, 2018 6:27 pm

OK. So I would get a small example working in Zeus, then move on to the bigger stuff like sprites. As others have said the Spectrum does not have Sprites, it's just code which tries to replicate what other machines did in hardware. Get a simple example working in your development environment of choice then move on. As mentioned the various documents, websites and books others have linked you to should get you started.
0 x

User avatar
Seven.FFF
Manic Miner
Posts: 204
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: Beginner's Sprite Tutorial

Post by Seven.FFF » Tue Mar 27, 2018 6:38 pm

That version of Spin has been abandonware for at least 11 years, so it's really unlikely there's going to be any more changes to make it easier to user. Dunny is an ace developer, but he's moved onto other projects long ago.

It would probably help you to use something actively developed. To contrast with Spin, In the 15 months I've been using Zeus I have 110 old versions saved in my archive. I honestly don't think it's an exaggeration to say that about 70% of those have workflow improvements, new features, etc resulting from my own feedback to Simon, and I'm only one of many people using the tool. The Windows Z80 cross-platform version has been developed on an almost a daily basis for the last ten years, and the design draws directly from the native Spectrum Zeus in the early 80s, and even older 8080 versions back to 1977.

Which is not to say that you have to use Zeus, by any means! Everyone has their favourite tools that feel right and suit their workflow, and nobody's making them use anything else. But if you're picking a new tool without any history or preconceptions, it seems a shame to hobble yourself right from the get go.
0 x
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
seven-fff.com/blog

User avatar
Seven.FFF
Manic Miner
Posts: 204
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: Beginner's Sprite Tutorial

Post by Seven.FFF » Tue Mar 27, 2018 6:41 pm

deletesprite, movesprite and drawsprite are from @R-Tape's tutorial in the first post of this topic, not my blog, so I can't offer any specific advice. What @PeterJ says is sound sense - build the foundations then work up from there.
0 x
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
seven-fff.com/blog

Post Reply