mrtomftw
Abandoned Uranium Working
Posts: 15
|
Post by mrtomftw on Mar 31, 2019 10:59:02 GMT
Just thinking of ways to avoid coloured sprites leaving a trail across the screen.
I know that normally you'd reset the SPRITEINK to whatever the common spriteink colour you're using is, so SPRITEINK 0 in my case. However, this does not account for sprites that pass in front of blocks that aren't using that SPRITEINK colour. So you end up with background blocks or platforms that get discoloured.
I tried to setting PARAMB to the SPRITEINK colour before setting the sprite colour, then reseting SPRITEINK to PARAMB but obviously that didn't work as SPRITEINK is a command... Anyone know of anyway to read the current value of SPRITEINK?
|
|
|
Post by alessandro on Mar 31, 2019 15:36:57 GMT
Hi, in AGD classic the simplest and safest way to avoid leaving "trails" of colour is to place the SPRITEINK [sprite colour] at the bottom of the sprite event, and SPRITEINK [background colour] at the beginning. This also means that you must set ink for all blocks that the sprite can pass through (platforms etc.) as the same ink as the background. E.g. if the common background block (empty space) is defined as black PAPER and white INK, all blocks that can be passed through must have white INK as well.
Otherwise you can define some background elements as CUSTOM blocks and let the sprite take the colour of such elements. I employed this trick in Apulija-13 v2.01. At the bottom of the sprite event you must place something like:
IF CUSTOM SPRITEINK [custom block ink] ELSE SPRITEINK [background block ink] ENDIF AGDx can let you define other kinds of blocks that are not affected by the sprite's colour. For that you will also need a bit of extra code, courtesy of A. Turvey (download link in the description):
|
|
mrtomftw
Abandoned Uranium Working
Posts: 15
|
Post by mrtomftw on Mar 31, 2019 17:31:14 GMT
Ah I thought that might be the case. A shame, but I'll just keep all my sprites the one colour and find excuses to add colour elsewhere instead.
Thanks again!
|
|