Page 1 of 1

Mirage

Posted: Tue Jul 29, 2014 8:46 pm
by peter
Hello,
have fun for a while.

Code: Select all

SCREEN 320,240

Global wAmp#,wFreq#,x#,m#,cx,dx
wAmp =22.0
wfreq=10.0

s1 = LoadImage("png/coollogo.png")
s2 = LoadImage("png/stupid.bmp")

While KeyDown(27)=0
   DrawImage s1,0,0
   x=x-10.5
   m=x
   For cx=0 To ImageHeight(s2)-1
       m =m+wfreq
   For dx=0 To ImageHeight(s2)-1    
       PickImageColor s2,dx,cx
       If getRGB(RED)+getRGB(GREEN)*256+getRGB(BLUE)*65536 >0 Then        
          Box 100+dx*4+Sin(m)*wamp+1*4,100+cx*2,4,4
       EndIf   
   Next dx
   Next cx
   Color 0,0,255    
   Text 120,16,"HELLO"
   DrawScreen OFF
Wend    

Re: Mirage

Posted: Wed Aug 06, 2014 7:34 pm
by CCE
Hi,

this is a legit sine wobbly sprite! You could try to make it faster with CopyBox or DrawImageBox that allow you to draw slices of images much faster.

The syntax of DrawImageBox is

Code: Select all

DRAWIMAGEBOX image, x, y, startX, startY, width, height, [frame], [transparent]
Keep up the good work :)