Computer Science Canada

dissolve slide fade

Author:  beedub [ Thu May 08, 2003 9:22 pm ]
Post subject:  dissolve slide fade

hey all i was thinking, when i change a scene in a program, i can make a dissolve or a cool scene movement. I was wondering how would i do that... locate,randint?

Author:  Tony [ Thu May 08, 2003 10:24 pm ]
Post subject: 

code:
colorback (black)

var r,c:int

for i:1..3000
r:= Rand.Int(1,maxrow-1)
c:= Rand.Int(1,maxcol)

locate(r,c)
put " "
end for


randomly color the screen in. It will be more "dissolving" if you use Draw.Dot instead...

Author:  Homer_simpson [ Thu May 08, 2003 10:36 pm ]
Post subject: 

i think u forgot to put this in your loop
code:
colorback (c)

Author:  Tony [ Thu May 08, 2003 10:38 pm ]
Post subject: 

code:

colorback(i)


but no, I wanted color to remain black so its consistant. If you keep on changing the colours though, you can cause some people to have siezures (probably bad spelling) Twisted Evil Fixed it. -Asok

Author:  beedub [ Sun May 11, 2003 9:31 pm ]
Post subject: 

ty soo much.. thats egcactly what i wanted

Author:  beedub [ Thu May 15, 2003 9:07 pm ]
Post subject: 

umm.. one quick question.. srry if this is newbish but.. what would the perimeters be for the drawdot ??... like drawdot (320,200,black)... or what?

Author:  void [ Thu May 15, 2003 9:12 pm ]
Post subject: 

drawdot (x,y,color)...ye...u were rite...

Author:  beedub [ Thu May 15, 2003 9:13 pm ]
Post subject: 

i know that.. but to correctly make the slide fade look proper... then what would the perimeters be?..like the coordinates... and void what school you go to??

Author:  beedub [ Thu May 15, 2003 9:31 pm ]
Post subject: 

nvm... i found out... this is what my final code is
code:
drawfillbox (0,0, 640, 400, black)

var r,c,r2,c2:int

for i:1..3000
r:= Rand.Int(1,maxrow-1)
c:= Rand.Int(1,maxcol)
r2:=Rand.Int (1,640)
c2:=Rand.Int (1,400)

locate(r,c)
drawfillbox (r2,c2,r2+10,c2+10,white)
delay (1)
end for
cls

thanks for the help;)

Author:  Homer_simpson [ Thu May 15, 2003 10:05 pm ]
Post subject: 

was bored tried to write something short...
code:
colorback(black)
cls
var x,y:array 1..1000 of int

for i:1..3000
for ii:1..1000
x(ii):=Rand.Int (1,640)
y(ii):=Rand.Int (1,400)
end for

for ii:1..1000
drawdot(x(ii),y(ii),white)
%drawfilloval(x(ii),y(ii),1,1,white)
end for
end for
cls

Author:  beedub [ Thu May 15, 2003 10:08 pm ]
Post subject: 

thats nice... the only problem is... it takes to long to end...

Author:  Martin [ Thu May 15, 2003 10:17 pm ]
Post subject: 

Whatchya making, beedub?

Author:  beedub [ Fri May 16, 2003 5:17 pm ]
Post subject: 

when i chage scenes in a program i want it to look cool... and make it just like a quick change of scene... so i make it dissolve..

Author:  Homer_simpson [ Fri May 16, 2003 6:23 pm ]
Post subject: 

this another fade to white effect...
code:
for decreasing ii : 255 .. 1 by 5
    RGB.SetColor (black, ii, ii, ii)
    colorback (black)
    cls
    delay (10)
end for

Author:  Homer_simpson [ Fri May 16, 2003 6:35 pm ]
Post subject: 

this is another effect it fades the black screen to yer image...
code:
View.Set ("offscreenonly")
var i := 257
for decreasing ii : 255 .. 1 by 1
    i -= 1
    RGB.SetColor (black, ii, ii, ii)
    colorback (black)
    cls
    RGB.SetColor (blue, i, i, 255)
    drawfillstar (1, 1, 300, 300, blue)
    View.Update
    %delay (5)
end for

Author:  beedub [ Fri May 16, 2003 8:57 pm ]
Post subject: 

ty homer... that last one is exactly wat i wanted.. the one i was doing didnt fade into my image... it when into a clear screen then my image... thanks alot...

Author:  DiamondDev [ Mon Jun 16, 2003 8:45 pm ]
Post subject:  Fade to black?

I know this is an old thread, but this is exactly what i need....cept i need it to fade to black.......any ideas?

Author:  PHP God [ Tue Jun 17, 2003 12:46 pm ]
Post subject: 

you guys are lame. Lets use some arrays. Here's my idea thus far, its not working though.

code:

var ybuff:array 0..ymax of boolean
var xpos:int
var ypos:int:=0
var flag:boolean:=false
setscreen ("graphics,nocursor,noecho")
procedure dissolve (color:int,delay:int)
 % Initialize and reset all values
  for i:0..xmax
   xbuff(i):=false
  end for
  for i:0..ymax
   ybuff(i):=false
  end for
 % Begin dissolve
  for i:0..ymax
   ypos:=ypos+1
   for j:0..xmax
    loop
    randint (xpos,0,xmax)
    if xbuff(xpos)=false then
     drawdot (xpos,ypos,color)
    end if
    xbuff(xpos):=true
    for ii:0..maxx
     if xbuff(i) = false then exit
     else flag := true
     end if
    end for
    if flag = true then exit
    end if
    end loop
   end for
  end for
end dissolve


basically, i have 2 arrays of boolean. when a dot gets colored in, its x position is TRUE, if it is uncolored it is FALSE. if an x position is already true, it will not be colored, if it is false color it. Then you check to see that all the dots in the row have been colored, if that is true then move on to the next row. I totally screwed that code up but that is my idea. I think I can make it now but my CPU class is almost over. my GR9 teacher can't help me because it is gr 11 stuff and she has to help all the newbs with MS Word Laughing

Author:  85882 [ Tue Jun 17, 2003 2:30 pm ]
Post subject: 

That's cool. Wink

Thanks!

Author:  DiamondDev [ Tue Jun 17, 2003 5:52 pm ]
Post subject:  Thanks

Hey,
Thanks for the code, even though you are rude. Should help me with the game I'm making...probably post it here when I'm finished and my Comp science course is over..seeing that its a final project........side scrollers are always fun to do...except its not a very practicle way of doing it when your screen is 800X 600

Answer to my own question
Modify Homer's code slightly Embarassed stupid me.....

for ii : 1 .. 255 by 1
RGB.SetColor (black, ii, ii, ii)
colorback (black)
cls
delay (10)
end for


: