update sprite color sp1_PutSprClr and sp1_IterateSprChar

ZX80, ZX 81, ZX Spectrum, TS2068 and other clones
Post Reply
jordi
Member
Posts: 61
Joined: Sun Oct 28, 2018 3:35 pm

update sprite color sp1_PutSprClr and sp1_IterateSprChar

Post by jordi »

Hi!

I would like to change a sprite colour during game loop, just when entering a dark room.

It's just from INK_BLACK to INK_CYAN.

Code: Select all

sp1_IterateSprChar(misifu.sp, initialiseColour);
doesn't seem to change it.

Code: Select all

sp1_IterateUpdateSpr
seems to be for another purpose, or I am wrong?

And I don't find a clear direction on how to change a sprite color using:

Code: Select all

sp1_PutSprClr

Could you help me?

Lot of thanks!
jordi
Member
Posts: 61
Joined: Sun Oct 28, 2018 3:35 pm

Re: update sprite color sp1_PutSprClr and sp1_IterateSprChar

Post by jordi »

Of course I mean during game loop.
Timmy
Well known member
Posts: 392
Joined: Sat Mar 10, 2012 4:18 pm

Re: update sprite color sp1_PutSprClr and sp1_IterateSprChar

Post by Timmy »

Maybe you are using "sp1_IterateSprChar(misifu.sp, initialiseColour);" wrong?

I just tried compiling an old sp1 example with the 2.1 sccz80 compiler, and it seems to work with a bit of updating. (see attachment, also, epilepsy warning!)

It could also be a compiler/compiler option problem, because my guess you are using some different settings. We will probably never know.
You do not have the required permissions to view the files attached to this post.
jordi
Member
Posts: 61
Joined: Sun Oct 28, 2018 3:35 pm

Re: update sprite color sp1_PutSprClr and sp1_IterateSprChar

Post by jordi »

So sp1_IterateSprChar works for updating a sprite color at any time? ok, I will recheck it.

In the meantime I used a cheaper trick of adding INK to background on such level, which seems to be the best in regards on memory consumption (much less code).
Timmy
Well known member
Posts: 392
Joined: Sat Mar 10, 2012 4:18 pm

Re: update sprite color sp1_PutSprClr and sp1_IterateSprChar

Post by Timmy »

jordi wrote: Mon Mar 08, 2021 2:18 pm In the meantime I used a cheaper trick of adding INK to background on such level, which seems to be the best in regards on memory consumption (much less code).
You are absolutely right. I would recommend this method too. It's cheaper and easier to set up. :)
Post Reply