1. Re: Your game KillDemo
Vikas B. Patel wrote:
> I spent the last 6 months writing code that does a decent fade! I'm
> just cursed, i can't figure it out. I even looked at Denthor's VGA
> tutorials and _COPIED_ the code, but it just does not look nice. Can you
> give me some pointers?
here is the code from my demo
pal is a length 256 sequence containing {R,B,G} palette colors.
brite is an integer ranging from 0 to 100
junk is an object:
--start--------------
junk=repeat({255,255,255},256)*(brite/100)
junk=junk+pal
for xx = 1 to 256 do
for yy = 1 to 3 do
if junk[xx][yy]>255 then
junk[xx][yy]=255
end if
end for
end for
end if
all_palette(junk/4)
--end------------------
this fades the palette bright (white-out).
just keep changing the value of brite and recalling the piece of code
(put it in a procedure), to fade the palette out to white and then back
to normal.
to fade the palette from normal color out to black
again pal is a palette sequence:
--start--------
for i = 1 to 0 by -.01 do
all_palette((pal*i)/4)
end for
--end--------
hope that helps!!
--Mark;
-------