Type Help!

Blitz3D Forums/Blitz3D Beginners Area/Type Help!

Well, all you would do is load the image into a global handle, then draw the image using it's global handle as many times as you need.

Graphics 800,600
SetBuffer BackBuffer()

Type img
   Field x#,y#
   Field speedx#
   Field speedy#
End Type

Global image=CreateImage(32,32)
SetBuffer ImageBuffer(image)
Rect 0,0,32,32
SetBuffer BackBuffer()

While Not KeyHit(1)
   Cls

   If KeyHit(2) Then
      create_new_type()
   End If

   update_types()
   Text 0,0," press 1 to generate new type"
   Flip
Wend

Function create_new_type()
   i.img=New img
   i\x=Rnd(100,700)
   i\y=Rnd(100,500)
   i\speedx=Rnd(0.5,3)
   i\speedy=Rnd(0.5,3)
End Function

Function update_types()
   For i.img= Each img
      i\x=i\x+i\speedx
      If i\x>740 Or i\x <50 Then
         i\speedx=i\speedx*-1
      End If
      i\y=i\y+i\speedy
      If i\y>540 Or i\y<50 Then
         i\speedx=i\speedx*-1
      End If
      DrawImage image,i\x,i\y
   Next
End Function