I know in order to use drawsprite over a sprite, I'm supposed to break the sync() command, but I can't figure why how.
Here is the example:
SetWindowSize(720,1280,0)
SetVirtualResolution(720,1280)
Type ShowerParticles
X as float
Y as float
Speed as float
SizeX as float
SizeY as float
Alpha as integer
EndType
ShowerParticles as ShowerParticles[-1]
NumParticles as integer
NumParticles=6000
PipeBg as integer
PipeBg=createsprite(LoadImage("pipebg.png"))
ShowerSprite=CreateSprite(0)
SetSpriteDepth(ShowerSprite,0)
for I=0 to NumParticles
ShowerParticles.Length=ShowerParticles.Length+1
ShowerRenew(I,ShowerParticles)
ShowerParticles[I].Y=Random(0,221)
next
do
for I=0 to NumParticles
SetSpritePositionByOffset(ShowerSprite,ShowerParticles[I].x,ShowerParticles[I].Y)
SetSpriteSize(ShowerSprite,ShowerParticles[I].sizeX,ShowerParticles[I].sizeY)
SetSpriteColor(ShowerSprite,255,255,255,ShowerParticles[I].Alpha)
DrawSprite(ShowerSprite)
ShowerParticles[i].y=ShowerParticles[I].Y+ShowerParticles[I].speed
if ShowerParticles[i].Y=>221
ShowerRenew(i,ShowerParticles)
endif
next
sync()
loop
Function ShowerRenew(I as integer, ShowerParticles ref as ShowerParticles[])
ShowerParticles[I].SizeX=1
ShowerParticles[I].SizeY=random(2.3,3.6)
ShowerParticles[I].X=random(0,576)
ShowerParticles[I].Y=-1
ShowerParticles[I].Speed=random(6,11)
ShowerParticles[I].Alpha=Random(60,128)
EndFunction
If I remove the background I can see the drawsprite() effect on the screen. Otherwise it doesn't show.
I believe my doubt relates to
this thread but I confess I didn't understand the resolution taken.