Actually, can someone help me combine this code please?
I need to make it so that when CTVal = maxtime, reset CTVal to maxtime then fadeout the sprite.
After EVERY 5 minutes, i need it to fade in a sprite saying "Like this? Then click here to go to the website". then fade out after 2 minutes of being displayed
global _oldTick as dword
global _newTick as dword : _newTick = hitimer()
global _delta as float
startTime# = 0
endTime# = 3.5
startValue = 255
endValue = 0
randomize timer()
sync on : sync rate 60
CTtimer = timer()
maxtime=3
CTVal = maxtime
cls rgb(255,144,23)
center text 32,8,"SPRITE"
get image 1,0,0,64,32,1
cls
sprite 1,0,0,1
do
if Timer() - CTtimer => 1000
Dec CTVal
CTtimer = Timer()
EndIf
If CTVal = 0 then CTVal=maxtime : nag()
_oldTick = _newTick
_newTick = hitimer()
_delta = (_newTick-_oldTick)
if CTVal>0
spriteElasped# = spriteElasped# + (_delta*0.001)
endif
if spriteElasped# > (endTime#)
spriteElasped# = 0.0
endTime# = rnd(3)+0.5
// this just flips the values to fade in and out
endValue = 255-endValue
startValue = 255-startValue
if startValue = 0
CTVal=3
endif
endif
spriteAlpha = int(LinearInterpolation( spriteElasped#, startTime#, endTime#, startValue, endValue ))
set sprite alpha 1, spriteAlpha
text 0,64,"Time: "+str$(spriteElasped#,2)
text 0,76,"Alpha: "+str$(spriteAlpha)
sync
loop
function nag()
endfunction
// single point to point linear interpolation
function LinearInterpolation( time as float, startTime as float, endTime as float, fromVal as float, toVal as float )
local out as float
// check if time is outside bounds and fire out resulting values
if (time < startTime) || (time > endTime)
if (time < startTime)
exitfunction fromVal
else
exitfunction toVal
endif
else
out = (((time-startTime) * (toVal-fromVal)) / (endTime-startTime)) + fromVal
endif
endfunction out
CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!