Posted: Mon Jan 06, 2003 5:00 pm
Restored from previous forum. Originally posted by Kendrel.
Iam converting some old stuff from me to Purebasic, and have a little problem now... it is a painter like game where you have to make the picture visible... so far everything works ok, but i guess iam doing it in a wrong way... take a look (snippet)
StartDrawing(SpriteOutput(2))
For i=0 To 20
For j=0 To 20
farben(i,j)=Point((Player1x-25)+i,(Player1y-26)+j)
Next j
Next i
StopDrawing()
StartDrawing(SpriteOutput(1))
For i=0 To 20
For j=0 To 20
If Point(player1x+i,player1y+j) = 0
Plot(Player1x+i,Player1y+j,farben(i,j)) ; Draw another point (Red)
starttimer+1
EndIf
Next j
Next i
DisplaySprite(#Player,Player1x,Player1y)
StopDrawing()
as you can see i retrieve the pixel information from the hidden picture via the Point command, and draw them later with the Plot command. This works i the size is only 20*20 on my 700 Duron, but well... there should be an other way to do this.
It would be nice to have a CopySpriteRect command for example where you could just clip a part of the sprite and copy it onto another (only overdraw)...
i hope you know what i mean and have some tips
so long,
kendrel
Iam converting some old stuff from me to Purebasic, and have a little problem now... it is a painter like game where you have to make the picture visible... so far everything works ok, but i guess iam doing it in a wrong way... take a look (snippet)
StartDrawing(SpriteOutput(2))
For i=0 To 20
For j=0 To 20
farben(i,j)=Point((Player1x-25)+i,(Player1y-26)+j)
Next j
Next i
StopDrawing()
StartDrawing(SpriteOutput(1))
For i=0 To 20
For j=0 To 20
If Point(player1x+i,player1y+j) = 0
Plot(Player1x+i,Player1y+j,farben(i,j)) ; Draw another point (Red)
starttimer+1
EndIf
Next j
Next i
DisplaySprite(#Player,Player1x,Player1y)
StopDrawing()
as you can see i retrieve the pixel information from the hidden picture via the Point command, and draw them later with the Plot command. This works i the size is only 20*20 on my 700 Duron, but well... there should be an other way to do this.
It would be nice to have a CopySpriteRect command for example where you could just clip a part of the sprite and copy it onto another (only overdraw)...
i hope you know what i mean and have some tips
so long,
kendrel